Permalink
Browse files

should not use class_variable here ,all class include the module shou…

…ld not share the @@spatial_fields and @@spatial_fields_indexes
  • Loading branch information...
1 parent fd2158e commit 23e18ee06eaa13bb2567d4515ac17544f201ee30 @niedhui niedhui committed Sep 26, 2012
Showing with 4 additions and 4 deletions.
  1. +2 −2 lib/mongoid_geospatial/geospatial.rb
  2. +2 −2 lib/mongoid_geospatial/helpers/spatial.rb
@@ -28,8 +28,8 @@ module Geospatial
included do
# attr_accessor :geo
cattr_accessor :spatial_fields, :spatial_fields_indexed
- @@spatial_fields = []
- @@spatial_fields_indexed = []
+ self.spatial_fields = []
+ self.spatial_fields_indexed = []
end
def self.use_rgeo
@@ -10,8 +10,8 @@
# end
model.class_eval do
- (self.spatial_fields ||= []) << field.name.to_sym
- (self.spatial_fields_indexed ||= []) << field.name.to_sym
+ self.spatial_fields << field.name.to_sym
+ self.spatial_fields_indexed << field.name.to_sym
# Create 2D index
spatial_index field.name

0 comments on commit 23e18ee

Please sign in to comment.