Sha256: d046c71816c9a583aa3b0865defac17f36c5d61252cf766ad00b2aaf17c47ec7
Contents?: true
Size: 491 Bytes
Versions: 8
Compression:
Stored size: 491 Bytes
Contents
require "cases/helper" require 'models/topic' module ActiveRecord class PredicateBuilderTest < ActiveRecord::TestCase def test_registering_new_handlers Topic.predicate_builder.register_handler(Regexp, proc do |column, value| Arel::Nodes::InfixOperation.new('~', column, Arel.sql(value.source)) end) assert_match %r{["`]topics["`]\.["`]title["`] ~ rails}i, Topic.where(title: /rails/).to_sql ensure Topic.reset_column_information end end end
Version data entries
8 entries across 8 versions & 1 rubygems