Files
redmine-budget-plugin/lib/issue_patch.rb
Eric Davis fd891e7f51 Changed the Redmine core patches to use the Rails dispatcher.
This will let the core patches work in development mode when the classes
are reloaded.
2009-04-10 08:49:12 -07:00

36 lines
744 B
Ruby

require_dependency 'issue'
# Patches Redmine's Issues dynamically. Adds a relationship
# Issue +belongs_to+ to Deliverable
module IssuePatch
def self.included(base) # :nodoc:
base.extend(ClassMethods)
base.send(:include, InstanceMethods)
# Same as typing in the class
base.class_eval do
unloadable # Send unloadable so it will not be unloaded in development
belongs_to :deliverable
end
end
module ClassMethods
end
module InstanceMethods
# Wraps the association to get the Deliverable subject. Needed for the
# Query and filtering
def deliverable_subject
unless self.deliverable.nil?
return self.deliverable.subject
end
end
end
end