Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…,count,where ...
  • Loading branch information...
commit af4fb711093845cca05b4e97601525690bcd90cd 1 parent 0c6f8bb
@niedhui niedhui authored
View
0  lib/mongoid/criterion/complex.rb → lib/mongoid/criterion/geo_complex.rb
File renamed without changes
View
0  lib/mongoid/criterion/inclusion.rb → lib/mongoid/criterion/geo_inclusion.rb
File renamed without changes
View
0  lib/mongoid/extensions/hash/criteria_helpers.rb → lib/mongoid/extensions/hash/geo_criteria_helpers.rb
File renamed without changes
View
0  lib/mongoid/extensions/symbol/inflections.rb → lib/mongoid/extensions/symbol/geo_inflections.rb
File renamed without changes
View
4 lib/mongoid/geo_criterion.rb
@@ -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
View
4 lib/mongoid/geo_extensions.rb
@@ -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
View
24 spec/mongoid/contexts/finder_spec.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.