mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
each to each_value; remove unused vars
This commit is contained in:
parent
136e3a46e1
commit
4f5e8af993
2 changed files with 3 additions and 3 deletions
|
@ -5,7 +5,7 @@ module ActiveRecord
|
||||||
include ThroughAssociation
|
include ThroughAssociation
|
||||||
|
|
||||||
def associated_records_by_owner
|
def associated_records_by_owner
|
||||||
super.each do |owner, records|
|
super.each_value do |records|
|
||||||
records.uniq! if reflection_scope.distinct_value
|
records.uniq! if reflection_scope.distinct_value
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -54,7 +54,7 @@ class CopyTableTest < ActiveRecord::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_copy_table_with_id_col_that_is_not_primary_key
|
def test_copy_table_with_id_col_that_is_not_primary_key
|
||||||
test_copy_table('goofy_string_id', 'goofy_string_id2') do |from, to, options|
|
test_copy_table('goofy_string_id', 'goofy_string_id2') do
|
||||||
original_id = @connection.columns('goofy_string_id').detect{|col| col.name == 'id' }
|
original_id = @connection.columns('goofy_string_id').detect{|col| col.name == 'id' }
|
||||||
copied_id = @connection.columns('goofy_string_id2').detect{|col| col.name == 'id' }
|
copied_id = @connection.columns('goofy_string_id2').detect{|col| col.name == 'id' }
|
||||||
assert_equal original_id.type, copied_id.type
|
assert_equal original_id.type, copied_id.type
|
||||||
|
@ -65,7 +65,7 @@ class CopyTableTest < ActiveRecord::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_copy_table_with_unconventional_primary_key
|
def test_copy_table_with_unconventional_primary_key
|
||||||
test_copy_table('owners', 'owners_unconventional') do |from, to, options|
|
test_copy_table('owners', 'owners_unconventional') do
|
||||||
original_pk = @connection.primary_key('owners')
|
original_pk = @connection.primary_key('owners')
|
||||||
copied_pk = @connection.primary_key('owners_unconventional')
|
copied_pk = @connection.primary_key('owners_unconventional')
|
||||||
assert_equal original_pk, copied_pk
|
assert_equal original_pk, copied_pk
|
||||||
|
|
Loading…
Reference in a new issue