Sha256: 7ca5a2d728060733df23367be2cc8f56e745cf69010c318e48107320cc5c1d05
Contents?: true
Size: 698 Bytes
Versions: 5
Compression:
Stored size: 698 Bytes
Contents
module DataMapper module Ambition module Query @@sexps = {} # TODO: spec and document this # @api semipublic def filter(negated = false, &block) # TODO: benchmark Marshal versus just building the sexp on demand # deep clone the sexp for multiple re-use sexp = Marshal.load(@@sexps[block.to_s] ||= Marshal.dump(block.to_sexp)) processor = FilterProcessor.new(block.binding, model, negated) processor.process(sexp) merge(:conditions => processor.conditions) end end # module Query end # module Ambition end # module DataMapper require Pathname(__FILE__).dirname.expand_path / 'query' / 'filter_processor'
Version data entries
5 entries across 5 versions & 1 rubygems