diff options
author | Erik Michaels-Ober <sferik@gmail.com> | 2014-03-03 19:23:22 -0800 |
---|---|---|
committer | Erik Michaels-Ober <sferik@gmail.com> | 2014-03-03 19:23:22 -0800 |
commit | 3413b88a3d6b2b022dfb57e42565446b1e024314 (patch) | |
tree | b3b7f62107f5fb6e76cdf0e90ea78395cacf2188 /activerecord/test/cases | |
parent | 817fe31196dd59ee31f71ef1740122b6759cf16d (diff) | |
download | rails-3413b88a3d6b2b022dfb57e42565446b1e024314.tar.gz rails-3413b88a3d6b2b022dfb57e42565446b1e024314.tar.bz2 rails-3413b88a3d6b2b022dfb57e42565446b1e024314.zip |
Replace map.flatten with flat_map in activerecord
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/associations/callbacks_test.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/autosave_association_test.rb | 4 |
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 |