Sha256: f6c6d786bb6ab9c1ef580d332db8fee473e6915b4097073d334df511eb6ef09e

Contents?: true

Size: 500 Bytes

Versions: 19

Compression:

Stored size: 500 Bytes

Contents

# encoding: utf-8
module Mongoid #:nodoc:
  module Extensions #:nodoc:
    module Hash #:nodoc:
      module CriteriaHelpers #:nodoc:
        def expand_complex_criteria
          hsh = {} 
          each_pair do |k,v|
            if k.respond_to?(:key) && k.respond_to?(:to_mongo_query)
              hsh[k.key] ||= {}
              hsh[k.key].merge!(k.to_mongo_query(v))
            else
              hsh[k] = v
            end
          end
          hsh
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
mongoid_spacial-0.2.17 lib/mongoid_spacial/extentions/hash/criteria_helpers.rb
sig_mongoid_spacial-0.2.17 lib/mongoid_spacial/extentions/hash/criteria_helpers.rb
cb_mongoid_spacial-0.2.16 lib/mongoid_spacial/extentions/hash/criteria_helpers.rb
mongoid_spacial-0.2.16 lib/mongoid_spacial/extentions/hash/criteria_helpers.rb
mongoid_spacial-0.2.13 lib/mongoid_spacial/extentions/hash/criteria_helpers.rb
mongoid_spacial-0.2.12 lib/mongoid_spacial/extentions/hash/criteria_helpers.rb
mongoid_spacial-0.2.11 lib/mongoid_spacial/extentions/hash/criteria_helpers.rb
mongoid_spacial-0.2.10 lib/mongoid_spacial/extentions/hash/criteria_helpers.rb
mongoid_spacial-0.2.8 lib/mongoid_spacial/extentions/hash/criteria_helpers.rb
mongoid_spacial-0.2.7 lib/mongoid_spacial/extentions/hash/criteria_helpers.rb
mongoid_spacial-0.2.6 lib/mongoid_spacial/extentions/hash/criteria_helpers.rb
mongoid_spacial-0.2.5 lib/mongoid_spacial/extentions/hash/criteria_helpers.rb
mongoid_spacial-0.2.4 lib/mongoid_spacial/extentions/hash/criteria_helpers.rb
mongoid_spacial-0.2.3 lib/mongoid_spacial/extentions/hash/criteria_helpers.rb
mongoid_spacial-0.2.2 lib/mongoid_spacial/extentions/hash/criteria_helpers.rb
mongoid_spacial-0.2.0 lib/mongoid_spacial/extentions/hash/criteria_helpers.rb
mongoid_spacial-0.1.1 lib/mongoid_spacial/extentions/hash/criteria_helpers.rb
mongoid_spacial-0.1.0 lib/mongoid_spacial/extentions/hash/criteria_helpers.rb
mongoid_spacial-0.0.1 lib/mongoid_spacial/extentions/hash/criteria_helpers.rb