diff --git a/app/models/issue.rb b/app/models/issue.rb index 2d00218..e8847ee 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -69,15 +69,29 @@ class Issue < ActiveRecord::Base before_create :default_assign before_save :reschedule_following_issues, :close_duplicates, :update_done_ratio_from_issue_status - after_save :update_nested_set_attributes, :update_parent_attributes, :create_journal + # HACK! + # This prevents a child issue from updating its parents. + after_save :update_nested_set_attributes, :create_journal + # We've retained the original line below: + # after_save :update_nested_set_attributes, :update_parent_attributes, :create_journal after_destroy :destroy_children - after_destroy :update_parent_attributes + # HACK! + # Commenting this line prevents a child issue from updating its parents. + # after_destroy :update_parent_attributes # Returns true if usr or current user is allowed to view the issue def visible?(usr=nil) (usr || User.current).allowed_to?(:view_issues, self.project) end + # HACK! + # This forces Redmine to believe the issue has no children, + # allowing us to update priority and due dates manually. + # WARNING: There are some unintended consequences: children are not deleted, etc. + def leaf? + true + end + def after_initialize if new_record? # set default values for new records only diff --git a/app/views/issues/show.rhtml b/app/views/issues/show.rhtml index b48ff2c..b39b281 100644 --- a/app/views/issues/show.rhtml +++ b/app/views/issues/show.rhtml @@ -1,5 +1,7 @@ <%= render :partial => 'action_menu' %> +<%= debug @priorities %> +

<%= @issue.tracker.name %> #<%= @issue.id %>