changeset 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 d0d6bbe9f2e0
children 7e89ba7fac48
files plugins/redmine_bibliography/app/models/publication.rb
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
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