diff options
author | Xavier Noria <fxn@hashref.com> | 2016-09-06 18:11:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-06 18:11:21 +0200 |
commit | 1722397f9a63f74bc7ff633895aec7109568a25b (patch) | |
tree | 78c05f68cc5bfe6eeed1eea9f9f68c40518903fb /activerecord/lib/active_record/nested_attributes.rb | |
parent | 2e4eb03925ae5854691a4318787e7707358615e8 (diff) | |
parent | fbccae4d190c91aa689defc2fbf25744b369df05 (diff) | |
download | rails-1722397f9a63f74bc7ff633895aec7109568a25b.tar.gz rails-1722397f9a63f74bc7ff633895aec7109568a25b.tar.bz2 rails-1722397f9a63f74bc7ff633895aec7109568a25b.zip |
Merge pull request #26405 from alexcameron89/case_statement_formatting
Fix Remaining Case-In-Assignment Statement Formatting
Diffstat (limited to 'activerecord/lib/active_record/nested_attributes.rb')
-rw-r--r-- | activerecord/lib/active_record/nested_attributes.rb | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/nested_attributes.rb b/activerecord/lib/active_record/nested_attributes.rb index 14af64c104..f0f88b120a 100644 --- a/activerecord/lib/active_record/nested_attributes.rb +++ b/activerecord/lib/active_record/nested_attributes.rb @@ -519,14 +519,15 @@ module ActiveRecord # larger than the limit. def check_record_limit!(limit, attributes_collection) if limit - limit = case limit - when Symbol - send(limit) - when Proc - limit.call - else - limit - end + limit = \ + case limit + when Symbol + send(limit) + when Proc + limit.call + else + limit + end if limit && attributes_collection.size > limit raise TooManyRecords, "Maximum #{limit} records are allowed. Got #{attributes_collection.size} records instead." |