adapt to changes to AR::Dirty

pull/6116/head
Jens Ulferts 7 years ago
parent 7c961e361c
commit 0b7e192a5d
No known key found for this signature in database
GPG Key ID: 3CAA4B1182CF5308
  1. 2
      app/models/message.rb
  2. 4
      app/models/relation/hierarchy_paths.rb
  3. 4
      app/models/version.rb

@ -132,7 +132,7 @@ class Message < ActiveRecord::Base
.or(with_parent_id)
.update_all("board_id = #{board_id}")
Board.reset_counters!(board_id_was)
Board.reset_counters!(board_id_before_last_save)
Board.reset_counters!(board_id)
end

@ -77,11 +77,11 @@ module Relation::HierarchyPaths
end
def hierarchy_relation_and_to_id_changed?
hierarchy? && to_id_changed?
hierarchy? && saved_change_to_to_id?
end
def alter_hierarchy_path
self.class.execute_sql self.class.remove_hierarchy_path_sql(to_id_was)
self.class.execute_sql self.class.remove_hierarchy_path_sql(to_id_before_last_save)
self.class.execute_sql self.class.add_hierarchy_path_sql(to_id)
end

@ -228,9 +228,9 @@ class Version < ActiveRecord::Base
# Update the issue's fixed versions. Used if a version's sharing changes.
def update_issues_from_sharing_change
if VERSION_SHARINGS.index(sharing_was).nil? ||
if VERSION_SHARINGS.index(sharing_before_last_save).nil? ||
VERSION_SHARINGS.index(sharing).nil? ||
VERSION_SHARINGS.index(sharing_was) > VERSION_SHARINGS.index(sharing)
VERSION_SHARINGS.index(sharing_before_last_save) > VERSION_SHARINGS.index(sharing)
WorkPackage.update_versions_from_sharing_change self
end
end

Loading…
Cancel
Save