diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2016-02-17 17:26:22 -0800 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2016-02-17 17:26:22 -0800 |
commit | 330c6af05c8b188eb072afa56c07d5fe15767c3c (patch) | |
tree | 492171e60a7a3882b2fe47ba7da547614626a767 /activerecord | |
parent | 04b410f83350aa8a9b6f181cc7c37f2c2653300f (diff) | |
parent | 4da96789273077e6afbee156803ecac846188c90 (diff) | |
download | rails-330c6af05c8b188eb072afa56c07d5fe15767c3c.tar.gz rails-330c6af05c8b188eb072afa56c07d5fe15767c3c.tar.bz2 rails-330c6af05c8b188eb072afa56c07d5fe15767c3c.zip |
Merge pull request #23736 from kamipo/remove_needless_case_insensitive_comparison_in_mysql2_adapter
Remove needless `case_insensitive_comparison` in mysql2 adapter
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_adapter.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 9 |
2 files changed, 4 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb index d9b42d4283..91ec921434 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb @@ -398,7 +398,7 @@ module ActiveRecord if can_perform_case_insensitive_comparison_for?(column) table[attribute].lower.eq(table.lower(Arel::Nodes::BindParam.new)) else - case_sensitive_comparison(table, attribute, column, value) + table[attribute].eq(Arel::Nodes::BindParam.new) end end diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb index 8751b6da4b..b12bac2737 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -615,13 +615,10 @@ module ActiveRecord end end - def case_insensitive_comparison(table, attribute, column, value) - if column.case_sensitive? - super - else - table[attribute].eq(Arel::Nodes::BindParam.new) - end + def can_perform_case_insensitive_comparison_for?(column) + column.case_sensitive? end + private :can_perform_case_insensitive_comparison_for? # In MySQL 5.7.5 and up, ONLY_FULL_GROUP_BY affects handling of queries that use # DISTINCT and ORDER BY. It requires the ORDER BY columns in the select list for |