aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2014-03-09 10:04:57 +0000
committerAndrew White <andyw@pixeltrix.co.uk>2014-03-09 10:04:57 +0000
commitec23277124b2f602bed1772926e687556de15176 (patch)
treef30c895b87e4c43ddb970011d25a22d3fb708667 /activerecord/test
parent45efd0ebf77811e43cebc68400c24652133a0f99 (diff)
parentcff340f1eda96be952437abeed80591a85ef0194 (diff)
downloadrails-ec23277124b2f602bed1772926e687556de15176.tar.gz
rails-ec23277124b2f602bed1772926e687556de15176.tar.bz2
rails-ec23277124b2f602bed1772926e687556de15176.zip
Merge pull request #14262 from sferik/flat_map
Replace additional instances of map.flatten with flat_map
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/associations/callbacks_test.rb2
-rw-r--r--activerecord/test/cases/autosave_association_test.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/test/cases/associations/callbacks_test.rb b/activerecord/test/cases/associations/callbacks_test.rb
index e555c52281..cf71bc1597 100644
--- a/activerecord/test/cases/associations/callbacks_test.rb
+++ b/activerecord/test/cases/associations/callbacks_test.rb
@@ -159,7 +159,7 @@ class AssociationCallbacksTest < ActiveRecord::TestCase
activerecord.reload
assert activerecord.developers_with_callbacks.size == 2
end
- log_array = activerecord.developers_with_callbacks.collect {|d| ["before_removing#{d.id}","after_removing#{d.id}"]}.flatten.sort
+ log_array = activerecord.developers_with_callbacks.flat_map {|d| ["before_removing#{d.id}","after_removing#{d.id}"]}.sort
assert activerecord.developers_with_callbacks.clear
assert_equal log_array, activerecord.developers_log.sort
end
diff --git a/activerecord/test/cases/autosave_association_test.rb b/activerecord/test/cases/autosave_association_test.rb
index d2f97df0fc..9651244372 100644
--- a/activerecord/test/cases/autosave_association_test.rb
+++ b/activerecord/test/cases/autosave_association_test.rb
@@ -76,9 +76,9 @@ class TestAutosaveAssociationsInGeneral < ActiveRecord::TestCase
end
def callbacks_for_model(model)
- model.instance_variables.grep(/_callbacks$/).map do |ivar|
+ model.instance_variables.grep(/_callbacks$/).flat_map do |ivar|
model.instance_variable_get(ivar)
- end.flatten
+ end
end
end