lib/searchlogic/named_scopes/column_conditions.rb in searchlogic-2.5.8 vs lib/searchlogic/named_scopes/column_conditions.rb in searchlogic-2.5.9
- old
+ new
@@ -57,11 +57,11 @@
super || column_condition?(name)
end
# We want to return true for any conditions that can be called, and while we're at it. We might as well
# create the condition so we don't have to do it again.
- def respond_to?(*args)
+ def respond_to_missing?(*args)
super || (self != ::ActiveRecord::Base && !self.abstract_class? && !create_condition(args.first).blank?)
end
private
def column_condition?(name)
@@ -111,10 +111,10 @@
def create_primary_condition(column_name, condition)
column = columns_hash[column_name.to_s]
column_type = column.type
skip_conversion = skip_time_zone_conversion_for_attributes.include?(column.name.to_sym)
- match_keyword = ::ActiveRecord::Base.connection.adapter_name == "PostgreSQL" ? "ILIKE" : "LIKE"
+ match_keyword = self.connection.adapter_name == "PostgreSQL" ? "ILIKE" : "LIKE"
scope_options = case condition.to_s
when /^equals/
scope_options(condition, column, "#{table_name}.#{column.name} = ?", :skip_conversion => skip_conversion)
when /^does_not_equal/