# HG changeset patch # User luisf # Date 1368809136 -3600 # Node ID 1c3e2fb6793a4f8afac44900dfed147ce7692687 # Parent d0d6bbe9f2e0e92be89956b6bb2b2801cc81f9b4 Fixed bug in human_attribute_name method; better handling of nested model errors. diff -r d0d6bbe9f2e0 -r 1c3e2fb6793a plugins/redmine_bibliography/app/models/publication.rb --- 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