Permalink
Browse files

rename some files, make they donot break mongoid's methods like first…

…,count,where ...
  • Loading branch information...
1 parent 0c6f8bb commit af4fb711093845cca05b4e97601525690bcd90cd @niedhui niedhui committed Jul 7, 2011
@@ -1,8 +1,8 @@
# encoding: utf-8
module Mongoid #:nodoc:
module Criterion #:nodoc:
- autoload :Complex, 'mongoid/criterion/complex'
- autoload :Inclusion, 'mongoid/criterion/inclusion'
+ autoload :Complex, 'mongoid/criterion/geo_complex'
+ autoload :Inclusion, 'mongoid/criterion/geo_inclusion'
autoload :NestedOperators, 'mongoid/criterion/nested_operators'
autoload :TwinOperators, 'mongoid/criterion/twin_operators'
end
@@ -2,11 +2,11 @@
module Mongoid #:nodoc:
module Extensions #:nodoc:
module Hash
- autoload :CriteriaHelpers, 'mongoid/extensions/hash/criteria_helpers'
+ autoload :CriteriaHelpers, 'mongoid/extensions/hash/geo_criteria_helpers'
end
module Symbol
- autoload :Inflections, 'mongoid/extensions/symbol/inflections'
+ autoload :Inflections, 'mongoid/extensions/symbol/geo_inflections'
end
end
end
@@ -0,0 +1,24 @@
+require "mongoid/spec_helper"
+
+# make sure mongoid-geo does not break mongoid
+describe Mongoid::Contexts::Mongo do
+
+ before(:each) do
+ Address.create(:location => [45, 11], :city => 'Munich')
+ Address.create(:location => [46, 12], :city => 'Berlin')
+ end
+
+ it "can count" do
+ Address.count.should == 2
+ end
+
+ it "can find using first" do
+ Address.first.city.should == 'Munich'
+ end
+
+ it "can find useing where" do
+ Address.where(:city => 'Munich').first.city.should == "Munich"
+ end
+
+
+end

0 comments on commit af4fb71

Please sign in to comment.