X-Git-Url: https://git.mdrn.pl/redakcja_redmine.git/blobdiff_plain/3cd0bfe5475b72e64c26b534e388f772878a408d..2119dcd48d7637772372f542358259b0cc384e35:/lib/redmine_publications/issue_patch.rb?ds=inline diff --git a/lib/redmine_publications/issue_patch.rb b/lib/redmine_publications/issue_patch.rb index f8a83c4..c108799 100644 --- a/lib/redmine_publications/issue_patch.rb +++ b/lib/redmine_publications/issue_patch.rb @@ -12,13 +12,7 @@ module RedminePublications unloadable # Send unloadable so it will not be unloaded in development validate :check_relations - after_save :update_relations - - # Add visible to Redmine 0.8.x - unless respond_to?(:visible) - named_scope :visible, lambda {|*args| { :include => :project, - :conditions => Project.allowed_to_condition(args.first || User.current, :view_issues) } } - end + after_save :update_relations end end @@ -61,9 +55,9 @@ module RedminePublications end def update_relations - self.reload old = self.publications current_names = self.publication_names + Rails.logger.info('[INFO] Updating relations: old= ' << old.inspect << ' current=' << current_names.inspect) # delete unused relations deleted = old.select { |v| not (current_names.include?(v.name)) }