method
attribute_condition
v2.3.8 -
Show latest stable
- Class:
ActiveRecord::Base
attribute_condition(quoted_column_name, argument)private
No documentation available.
# File activerecord/lib/active_record/base.rb, line 2027
def attribute_condition(quoted_column_name, argument)
case argument
when nil then "#{quoted_column_name} IS ?"
when Array, ActiveRecord::Associations::AssociationCollection, ActiveRecord::NamedScope::Scope then "#{quoted_column_name} IN (?)"
when Range then if argument.exclude_end?
"#{quoted_column_name} >= ? AND #{quoted_column_name} < ?"
else
"#{quoted_column_name} BETWEEN ? AND ?"
end
else "#{quoted_column_name} = ?"
end
end