lib/wherex/connection.rb in wherex-1.0.0 vs lib/wherex/connection.rb in wherex-1.0.1

- old
+ new

@@ -21,10 +21,10 @@ my_adapter = "Wherex::#{my_adapter_name}".constantize adapter.send :include, my_adapter rescue NameError => e end - if defined? ::ActiveRecord::ConnectionAdapters::SQLiteAdapter + if ::ActiveRecord::Base.connection.raw_connection.respond_to? :create_function ::ActiveRecord::Base.connection.raw_connection.create_function( "regexp", 2 ) do |context, pattern, string| if string.present? context.result = 1 if string.match pattern end end