aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/nested_attributes.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-09-06 18:11:21 +0200
committerGitHub <noreply@github.com>2016-09-06 18:11:21 +0200
commit1722397f9a63f74bc7ff633895aec7109568a25b (patch)
tree78c05f68cc5bfe6eeed1eea9f9f68c40518903fb /activerecord/lib/active_record/nested_attributes.rb
parent2e4eb03925ae5854691a4318787e7707358615e8 (diff)
parentfbccae4d190c91aa689defc2fbf25744b369df05 (diff)
downloadrails-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.rb17
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."