Sha256: 81ee2e97651c4582c74a27eb0ddf3b0d6d6d27506d371203cd7b1edb2b976ac2
Contents?: true
Size: 812 Bytes
Versions: 11
Compression:
Stored size: 812 Bytes
Contents
require "mobility/backends/active_record/query_methods" module Mobility module Backends class ActiveRecord::Serialized::QueryMethods < ActiveRecord::QueryMethods def initialize(attributes, _) super attributes_extractor = @attributes_extractor opts_checker = @opts_checker = Backends::Serialized.attr_checker(attributes_extractor) define_method :where! do |opts, *rest| opts_checker.call(opts) || super(opts, *rest) end end def extended(relation) super opts_checker = @opts_checker mod = Module.new do define_method :not do |opts, *rest| opts_checker.call(opts) || super(opts, *rest) end end relation.mobility_where_chain.include(mod) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems