# HG changeset patch # User luisf # Date 1376926389 -3600 # Node ID a2e51c0a78608833203a2691a51995c1596cdb67 # Parent 7e85f7988ab83180bbaa8c175fdc95233e229c5b Correctly clears the cache when publication authors' order is changed. diff -r 7e85f7988ab8 -r a2e51c0a7860 plugins/redmine_bibliography/app/models/authorship.rb --- a/plugins/redmine_bibliography/app/models/authorship.rb Mon Aug 19 16:23:24 2013 +0100 +++ b/plugins/redmine_bibliography/app/models/authorship.rb Mon Aug 19 16:33:09 2013 +0100 @@ -12,6 +12,7 @@ attr_accessor :search_author_class, :search_author_id, :search_name, :search_results, :identify_author before_create :associate_author_user + before_update :delete_publication_cache # tod: review scope of ordering acts_as_list :column => 'auth_order' @@ -46,10 +47,14 @@ end protected + + def delete_publication_cache + publication = Publication.find(self.publication_id) + Rails.cache.delete "publication-#{publication.id}-ieee" + Rails.cache.delete "publication-#{publication.id}-bibtex" + end + def associate_author_user - - logger.error { "search_author_class '#{self.search_author_class}'" } - case self.search_author_class when "" logger.debug { "Unknown Author to be added..." }