diff options
author | José Valim <jose.valim@gmail.com> | 2010-12-01 11:42:30 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-12-01 11:42:30 +0100 |
commit | 1ec126dd37b52ecf7c0c24a842fc87836d8f2e9b (patch) | |
tree | 8b1341b89a2c2f8511d9e84dcec551ed08a395c4 /activemodel/lib/active_model | |
parent | ba63c0a9b58691adeca645977828ee918107208d (diff) | |
download | rails-1ec126dd37b52ecf7c0c24a842fc87836d8f2e9b.tar.gz rails-1ec126dd37b52ecf7c0c24a842fc87836d8f2e9b.tar.bz2 rails-1ec126dd37b52ecf7c0c24a842fc87836d8f2e9b.zip |
Revert "Fix generation of wrong json string when field has multiple errors"
This reverts commit a9b666b51d28b2e74da630c31327dee7cbe96d37.
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r-- | activemodel/lib/active_model/errors.rb | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb index 01ca540d28..99f47f2cbe 100644 --- a/activemodel/lib/active_model/errors.rb +++ b/activemodel/lib/active_model/errors.rb @@ -167,16 +167,6 @@ module ActiveModel def as_json(options=nil) self end - - def encode_json(encoder) - errors = [] - each_pair do |key, value| - value = value.first if value.size == 1 - errors << "#{encoder.encode(key.to_s)}:#{encoder.encode(value, false)}" - end - - "{#{errors * ','}}" - end # Adds +message+ to the error messages on +attribute+, which will be returned on a call to # <tt>on(attribute)</tt> for the same attribute. More than one error can be added to the same |