diff options
author | José Valim <jose.valim@gmail.com> | 2011-06-08 23:36:49 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-06-08 23:36:49 -0700 |
commit | af3f0b6204dd81b4df50dbc567276bf5c8264ebe (patch) | |
tree | 8949125520a4bad1638bc988c8858399177550ac /activerecord | |
parent | 077f65c36f4feff65f5a94180943927c35e280f0 (diff) | |
parent | 9af4e803ec713352532bbe6539984528439a1257 (diff) | |
download | rails-af3f0b6204dd81b4df50dbc567276bf5c8264ebe.tar.gz rails-af3f0b6204dd81b4df50dbc567276bf5c8264ebe.tar.bz2 rails-af3f0b6204dd81b4df50dbc567276bf5c8264ebe.zip |
Merge pull request #1591 from smartinez87/unused
Fix "warning: assigned but unused variable" on AR tests
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/mysql_adapter.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/adapters/mysql2/reserved_word_test.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb index 8d7dd8bacf..9e6cb13cca 100644 --- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb @@ -707,7 +707,7 @@ module ActiveRecord def quoted_columns_for_index(column_names, options = {}) length = options[:length] if options.is_a?(Hash) - quoted_column_names = case length + case length when Hash column_names.map {|name| length[name] ? "#{quote_column_name(name)}(#{length[name]})" : quote_column_name(name) } when Fixnum diff --git a/activerecord/test/cases/adapters/mysql2/reserved_word_test.rb b/activerecord/test/cases/adapters/mysql2/reserved_word_test.rb index 752b864818..3a9744e78f 100644 --- a/activerecord/test/cases/adapters/mysql2/reserved_word_test.rb +++ b/activerecord/test/cases/adapters/mysql2/reserved_word_test.rb @@ -87,8 +87,8 @@ class MysqlReservedWordTest < ActiveRecord::TestCase assert_nothing_raised { x.save } x.order = 'y' assert_nothing_raised { x.save } - assert_nothing_raised { y = Group.find_by_order('y') } - assert_nothing_raised { y = Group.find(1) } + assert_nothing_raised { Group.find_by_order('y') } + assert_nothing_raised { Group.find(1) } x = Group.find(1) end |