Permalink
Browse files

Make the code easier to read.

  • Loading branch information...
1 parent 6d309d7 commit b9db00187926297f0b4a417b22f763861287feb1 @gabebw gabebw committed Apr 10, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/shoulda/matchers/active_model/helpers.rb
@@ -20,12 +20,12 @@ def pretty_error_messages(obj) # :nodoc:
def default_error_message(key, options = {})
model_name = options.delete(:model_name)
attribute = options.delete(:attribute)
- I18n.translate( :"activerecord.errors.models.#{model_name}.attributes.#{attribute}.#{key}", {
- :default => [ :"activerecord.errors.models.#{model_name}.#{key}",
- :"activerecord.errors.messages.#{key}",
- :"errors.attributes.#{attribute}.#{key}",
- :"errors.messages.#{key}"
- ]}.merge(options))
+ default_translation = [ :"activerecord.errors.models.#{model_name}.#{key}",
+ :"activerecord.errors.messages.#{key}",
+ :"errors.attributes.#{attribute}.#{key}",
+ :"errors.messages.#{key}" ]
+ I18n.translate(:"activerecord.errors.models.#{model_name}.attributes.#{attribute}.#{key}",
+ { :default => default_translation }.merge(options))
end
end
end

0 comments on commit b9db001

Please sign in to comment.