diff options
author | Zamith <zamith.28@gmail.com> | 2015-05-04 13:36:26 +0100 |
---|---|---|
committer | Zamith <zamith.28@gmail.com> | 2015-05-04 13:36:26 +0100 |
commit | 6f418a09d82351ae74409379f80012f717aa9cb0 (patch) | |
tree | 58f68e5f6129e30c2e305e3f4797fdbe59ae22aa /activemodel/lib/active_model | |
parent | 21c74bd769f6c873453e9244b0de7ced40a532be (diff) | |
download | rails-6f418a09d82351ae74409379f80012f717aa9cb0.tar.gz rails-6f418a09d82351ae74409379f80012f717aa9cb0.tar.bz2 rails-6f418a09d82351ae74409379f80012f717aa9cb0.zip |
Adds/Corrects use case for adding an error message
I believe this is a use case that was supposed to be supported, and it's
a small fix.
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r-- | activemodel/lib/active_model/errors.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb index f843b279ce..287a2559d2 100644 --- a/activemodel/lib/active_model/errors.rb +++ b/activemodel/lib/active_model/errors.rb @@ -452,7 +452,6 @@ module ActiveModel defaults = [] end - defaults << options.delete(:message) defaults << :"#{@base.class.i18n_scope}.errors.messages.#{type}" if @base.class.respond_to?(:i18n_scope) defaults << :"errors.attributes.#{attribute}.#{type}" defaults << :"errors.messages.#{type}" @@ -461,6 +460,7 @@ module ActiveModel defaults.flatten! key = defaults.shift + defaults = options.delete(:message) if options[:message] value = (attribute != :base ? @base.send(:read_attribute_for_validation, attribute) : nil) options = { |