1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #23736 from kamipo/remove_needless_case_insensitive_comparison_in_mysql2_adapter

Remove needless `case_insensitive_comparison` in mysql2 adapter
This commit is contained in:
Sean Griffin 2016-02-17 17:26:22 -08:00
commit 330c6af05c
2 changed files with 4 additions and 7 deletions

View file

@ -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

View file

@ -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