Permalink
Browse files

Use 'self' to get the connection of the object being searched upon. T…

…his is needed in multi-db environments when different databases are used.
  • Loading branch information...
1 parent 3e669b7 commit 4e8da804ad00ccd135dd5e3df324a6342bdd2644 @ak47 ak47 committed Jan 2, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/searchlogic/named_scopes/column_conditions.rb
@@ -113,7 +113,7 @@ 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/

0 comments on commit 4e8da80

Please sign in to comment.