Sha256: 89d1ae19bd8524521c1fa1f5e0097c311d24a02d0412a4f1432529007dd301f9
Contents?: true
Size: 435 Bytes
Versions: 10
Compression:
Stored size: 435 Bytes
Contents
require "cases/helper" require 'models/topic' module ActiveRecord class PredicateBuilderTest < ActiveRecord::TestCase def test_registering_new_handlers PredicateBuilder.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 end end end
Version data entries
10 entries across 10 versions & 2 rubygems