# HG changeset patch # User Chris Cannam # Date 1312896622 -3600 # Node ID 5404f7dfb4b352fb8b0eb319b66b7c8e034fc47f # Parent b18f1971024270549cbe7fa2e4f18ca505206068 Move set_initial_author_order to before_save to avoid duplicate author creation; Remove unwanted has-one relationship between user and publication diff -r b18f19710242 -r 5404f7dfb4b3 vendor/plugins/redmine_bibliography/app/models/publication.rb --- a/vendor/plugins/redmine_bibliography/app/models/publication.rb Tue Aug 09 14:29:10 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/models/publication.rb Tue Aug 09 14:30:22 2011 +0100 @@ -16,7 +16,7 @@ has_and_belongs_to_many :projects, :uniq => true - after_save :set_initial_author_order + before_save :set_initial_author_order def set_initial_author_order authorships = self.authorships @@ -26,7 +26,6 @@ authorships.each_with_index do |authorship, index| if authorship.auth_order.nil? authorship.auth_order = index - authorship.update end end end diff -r b18f19710242 -r 5404f7dfb4b3 vendor/plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb --- a/vendor/plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb Tue Aug 09 14:29:10 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb Tue Aug 09 14:30:22 2011 +0100 @@ -6,10 +6,6 @@ base.send(:include, InstanceMethods) extend ClassMethods - base.class_eval do - has_one :publication - - end end #self.included module ClassMethods @@ -48,4 +44,4 @@ end #InstanceMethods end #UserPublicationsPatch -end #RedmineBibliography \ No newline at end of file +end #RedmineBibliography