Skip to content
This repository has been archived by the owner on Oct 17, 2018. It is now read-only.

Commit

Permalink
fix error lookup key order in i18n calls
Browse files Browse the repository at this point in the history
  • Loading branch information
paulschreiber committed May 8, 2012
1 parent 5a27d3b commit 2d3db42
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ def validate_each(record, attribute, value)


model_name = record.class.to_s model_name = record.class.to_s


item_name = I18n.t("activerecord.models.attributes.#{model_name.underscore}.#{attribute}", item_name = I18n.t("activerecord.models.#{model_name.underscore}.attributes.#{attribute}",
:default => nil) or options[:attribute_name] or attribute :default => nil) or options[:attribute_name] or attribute


if error == ALL_CAPS if error == ALL_CAPS
message = I18n.t("activerecord.errors.models.attributes.#{model_name.underscore}.#{attribute}.all_caps", message = I18n.t("activerecord.errors.models.#{model_name.underscore}.attributes.#{attribute}.all_caps",
:item => item_name, :item => item_name,
:default => [:"activerecord.errors.models.#{model_name.underscore}.all_caps", :default => [:"activerecord.errors.models.#{model_name.underscore}.all_caps",
options[:all_caps], options[:all_caps],
:'activerecord.errors.messages.all_caps']) :'activerecord.errors.messages.all_caps'])
elsif error == ALL_LOWERCASE elsif error == ALL_LOWERCASE
message = I18n.t("activerecord.errors.models.attributes.#{model_name.underscore}.#{attributes}.all_lowercase", message = I18n.t("activerecord.errors.models.#{model_name.underscore}.attributes.#{attributes}.all_lowercase",
:item => item_name, :item => item_name,
:default => [:"activerecord.errors.models.#{model_name.underscore}.all_lowercase", :default => [:"activerecord.errors.models.#{model_name.underscore}.all_lowercase",
options[:all_lowercase], options[:all_lowercase],
Expand Down

0 comments on commit 2d3db42

Please sign in to comment.