# HG changeset patch # User luisf # Date 1309434850 -3600 # Node ID 7be2c5d9ffa598cc3a54227445797f8cf9a71f26 # Parent 7097dc91e58e3e1ef90704f3b91101c68ac9d7bb correctly saving ONE authorship model when creating new publication. diff -r 7097dc91e58e -r 7be2c5d9ffa5 vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb --- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Wed Jun 29 17:12:03 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Thu Jun 30 12:54:10 2011 +0100 @@ -67,11 +67,11 @@ logger.error { "current user has no author" } @author = Author.new(:user_id => User.current, :name => User.current.name) else - logger.error { "current user does not have an author" } + logger.error { "current user already has an author" } @author = User.current.author end - @authorship = Authorship.create(:author => @author, :publication => @publication) + # @authorship = Authorship.create(:author => @author, :publication => @publication) else # No? Then render an action. #render :action => 'view_attribute', :attr => @name diff -r 7097dc91e58e -r 7be2c5d9ffa5 vendor/plugins/redmine_bibliography/app/views/publications/add_me_as_author.rjs --- a/vendor/plugins/redmine_bibliography/app/views/publications/add_me_as_author.rjs Wed Jun 29 17:12:03 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/add_me_as_author.rjs Thu Jun 30 12:54:10 2011 +0100 @@ -1,2 +1,3 @@ page["publication_authorships_attributes_0_name_on_paper"].value = User.current.name -page["publication_authorships_attributes_0_institution"].value = User.current.ssamr_user_detail.institution_id.to_i +page["publication_authorships_attributes_0_institution"].value = Institution.find(User.current.ssamr_user_detail.institution_id.to_i).name +page["publication_authorships_attributes_0_email"].value = User.current.mail \ No newline at end of file