diff options
author | Matthew Draper <matthew@trebex.net> | 2017-05-24 13:10:26 +0930 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-24 13:10:26 +0930 |
commit | 3a354792a2498e60a7d9934e30b8840ad1719ff6 (patch) | |
tree | 0693387ccef54dea19f3d8b43cf14ba0a162ecb7 /activerecord/lib/active_record | |
parent | 845aabbcd3805420090f8b92b50a4562577cf210 (diff) | |
parent | 78ad8098ba46ec59eb0d6e9d1280339e1294e093 (diff) | |
download | rails-3a354792a2498e60a7d9934e30b8840ad1719ff6.tar.gz rails-3a354792a2498e60a7d9934e30b8840ad1719ff6.tar.bz2 rails-3a354792a2498e60a7d9934e30b8840ad1719ff6.zip |
Merge pull request #29184 from kirs/nested-attributes-friendly-error
More friendly exception in nested attributes
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/nested_attributes.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/nested_attributes.rb b/activerecord/lib/active_record/nested_attributes.rb index 01ecd79b8f..3f39fb84e8 100644 --- a/activerecord/lib/active_record/nested_attributes.rb +++ b/activerecord/lib/active_record/nested_attributes.rb @@ -458,7 +458,7 @@ module ActiveRecord end unless attributes_collection.is_a?(Hash) || attributes_collection.is_a?(Array) - raise ArgumentError, "Hash or Array expected, got #{attributes_collection.class.name} (#{attributes_collection.inspect})" + raise ArgumentError, "Hash or Array expected for attribute `#{association_name}`, got #{attributes_collection.class.name} (#{attributes_collection.inspect})" end check_record_limit!(options[:limit], attributes_collection) |