Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

criteria_helpers were not updated correctly in 2.3

  • Loading branch information...
commit 2b939c8803e8b896e258e2bef61a1f5e37e28ea3 1 parent bb50b7a
@ryanong ryanong authored
View
1  lib/mongoid_spacial.rb
@@ -4,6 +4,7 @@
require 'mongoid_spacial/contexts/mongo'
require 'mongoid_spacial/criteria'
require 'mongoid_spacial/criterion'
+require 'mongoid_spacial/extentions/hash/criteria_helpers'
require 'mongoid_spacial/extentions/symbol/inflections'
require 'mongoid_spacial/field_option'
require 'mongoid_spacial/finders'
View
22 lib/mongoid_spacial/extentions/hash/criteria_helpers.rb
@@ -0,0 +1,22 @@
+# 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
+
View
2  lib/mongoid_spacial/spacial/version.rb
@@ -1,5 +1,5 @@
module Mongoid
module Spacial
- VERSION = "0.2.15"
+ VERSION = "0.2.16"
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.