Mercurial > hg > soundsoftware-site
diff plugins/redmine_bibliography/app/models/publication.rb @ 1287:1c3e2fb6793a redmine-2.2-integration
Fixed bug in human_attribute_name method; better handling of nested model errors.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Fri, 17 May 2013 17:45:36 +0100 |
parents | 1186340b4ad4 |
children | 2abc48cc545e |
line wrap: on
line diff
--- a/plugins/redmine_bibliography/app/models/publication.rb Tue May 14 19:09:34 2013 +0100 +++ b/plugins/redmine_bibliography/app/models/publication.rb Fri May 17 17:45:36 2013 +0100 @@ -10,6 +10,7 @@ validates_presence_of :title validates_length_of :authorships, :minimum => 1, :message => l("error_no_authors") + validates_associated :bibtex_entry, :authorships accepts_nested_attributes_for :authorships accepts_nested_attributes_for :authors, :allow_destroy => true @@ -41,7 +42,7 @@ # Ensure error message uses proper text instead of # bibtex_entry.entry_type (#268). There has to be a better way to # do this! - def self.human_attribute_name(k) + def self.human_attribute_name(k, *args) if k == 'bibtex_entry.entry_type' l(:field_entry_type) else