Skip to content

Instantly share code, notes, and snippets.

@retorquere
Created Jul 2, 2010
Embed
What would you like to do?
Dispatcher.to_prepare do
require_dependency 'version'
require_dependency 'issue'
require_dependency 'issue_relation'
require_dependency 'version'
require_dependency 'project'
Issue::SAFE_ATTRIBUTES << "story_points" if Issue.const_defined? "SAFE_ATTRIBUTES"
Issue::SAFE_ATTRIBUTES << "remaining_hours" if Issue.const_defined? "SAFE_ATTRIBUTES"
Issue::SAFE_ATTRIBUTES << "position" if Issue.const_defined? "SAFE_ATTRIBUTES"
Query.send(:include, QueryPatch) unless Query.included_modules.include? QueryPatch
Issue.send(:include, IssuePatch) unless Issue.included_modules.include? IssuePatch
Version.send(:include, VersionPatch) unless Version.included_modules.include? VersionPatch
Project.send(:include, ProjectPatch) unless Project.included_modules.include? ProjectPatch
end
module IssuePatch
def self.included(base) # :nodoc:
base.extend(ClassMethods)
base.send(:include, InstanceMethods)
base.class_eval do
unloadable
alias_method_chain :move_to_project_without_transaction, :autolink
alias_method_chain :recalculate_attributes_for, :remaining_hours
after_save :task_follows_story
end
end
module ClassMethods
end
module InstanceMethods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment