Permalink
Browse files

fix error lookup key order in i18n calls

  • Loading branch information...
paulschreiber committed May 8, 2012
1 parent 5a27d3b commit 2d3db420b47c59ed5070af880ace1865d3e5f5d4
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/validation_kit/mixed_case_validator/mixed_case_validator.rb
@@ -18,17 +18,17 @@ def validate_each(record, attribute, value)
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
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,
:default => [:"activerecord.errors.models.#{model_name.underscore}.all_caps",
options[:all_caps],
:'activerecord.errors.messages.all_caps'])
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,
:default => [:"activerecord.errors.models.#{model_name.underscore}.all_lowercase",
options[:all_lowercase],

0 comments on commit 2d3db42

Please sign in to comment.