Sha256: 86b9cd247d331f0fc0af1b8bd8e7ebdc59213da41d2b4671bfd788ec40584fcb

Contents?: true

Size: 451 Bytes

Versions: 23

Compression:

Stored size: 451 Bytes

Contents

# encoding: utf-8
module Mongoid #:nodoc:
  module Extensions #:nodoc:
    module Hash #:nodoc:
      module CriteriaHelpers #:nodoc:
        def expand_complex_criteria
          hsh = {}
          self.each_pair do |k,v|
            if k.class == Mongoid::ComplexCriterion
              hsh[k.key] = {"$#{k.operator}" => v}
            else
              hsh[k] = v
            end
          end
          hsh
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
mongoid-1.1.3 lib/mongoid/extensions/hash/criteria_helpers.rb
mongoid-1.1.2 lib/mongoid/extensions/hash/criteria_helpers.rb
mongoid-1.1.1 lib/mongoid/extensions/hash/criteria_helpers.rb
mongoid-1.1.0 lib/mongoid/extensions/hash/criteria_helpers.rb
mongoid-1.0.6 lib/mongoid/extensions/hash/criteria_helpers.rb
mongoid-1.0.5 lib/mongoid/extensions/hash/criteria_helpers.rb
mongoid-1.0.4 lib/mongoid/extensions/hash/criteria_helpers.rb
mongoid-1.0.3 lib/mongoid/extensions/hash/criteria_helpers.rb
mongoid-1.0.2 lib/mongoid/extensions/hash/criteria_helpers.rb
mongoid-1.0.1 lib/mongoid/extensions/hash/criteria_helpers.rb
mongoid-1.0.0 lib/mongoid/extensions/hash/criteria_helpers.rb
mongoid-0.12.0 lib/mongoid/extensions/hash/criteria_helpers.rb
mongoid-0.11.9 lib/mongoid/extensions/hash/criteria_helpers.rb
mongoid-0.11.8 lib/mongoid/extensions/hash/criteria_helpers.rb
mongoid-0.11.7 lib/mongoid/extensions/hash/criteria_helpers.rb
mongoid-0.11.6 lib/mongoid/extensions/hash/criteria_helpers.rb
mongoid-0.11.5 lib/mongoid/extensions/hash/criteria_helpers.rb
mongoid-0.11.4 lib/mongoid/extensions/hash/criteria_helpers.rb
mongoid-0.11.3 lib/mongoid/extensions/hash/criteria_helpers.rb
mongoid-0.11.2 lib/mongoid/extensions/hash/criteria_helpers.rb