diff options
author | Semyon Pupkov <mail@semyonpupkov.com> | 2017-09-21 21:07:06 +0500 |
---|---|---|
committer | Semyon Pupkov <mail@semyonpupkov.com> | 2018-04-28 16:27:16 +0500 |
commit | 2253f6cca10d5dd474654138e6190481ae764bc6 (patch) | |
tree | 4fd7883a98e0bb54ffa97478721ce1ed04fd3604 /activemodel/lib | |
parent | 276fe661098619239ac90c110b06d72b3fc77b5c (diff) | |
download | rails-2253f6cca10d5dd474654138e6190481ae764bc6.tar.gz rails-2253f6cca10d5dd474654138e6190481ae764bc6.tar.bz2 rails-2253f6cca10d5dd474654138e6190481ae764bc6.zip |
Improve error message when assign wrong attributes to model
Diffstat (limited to 'activemodel/lib')
-rw-r--r-- | activemodel/lib/active_model/attribute_assignment.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/attribute_assignment.rb b/activemodel/lib/active_model/attribute_assignment.rb index 217bf1ac01..f0e3458f51 100644 --- a/activemodel/lib/active_model/attribute_assignment.rb +++ b/activemodel/lib/active_model/attribute_assignment.rb @@ -27,7 +27,7 @@ module ActiveModel # cat.status # => 'sleeping' def assign_attributes(new_attributes) if !new_attributes.respond_to?(:stringify_keys) - raise ArgumentError, "When assigning attributes, you must pass a hash as an argument." + raise ArgumentError, "When assigning attributes, you must pass a hash as an argument, #{new_attributes.class} passed." end return if new_attributes.empty? |