Sha256: ce8b1d3b0babff66ef2ef0d354e0d9b90025a0d86e55cd28555a71501df794d2

Contents?: true

Size: 877 Bytes

Versions: 69

Compression:

Stored size: 877 Bytes

Contents

require 'geocoder/models/base'
require 'geocoder/models/mongo_base'

module Geocoder
  module Model
    module Mongoid
      include Base
      include MongoBase

      def self.included(base); base.extend(self); end

      private # --------------------------------------------------------------

      def geocoder_file_name;   "mongoid"; end
      def geocoder_module_name; "Mongoid"; end

      def geocoder_init(options)
        super(options)
        if options[:skip_index] == false
          # create 2d index
          if defined?(::Mongoid::VERSION) && ::Mongoid::VERSION >= "3"
            index({ geocoder_options[:coordinates].to_sym => '2d' }, 
                  {:min => -180, :max => 180})
          else
            index [[ geocoder_options[:coordinates], '2d' ]],
              :min => -180, :max => 180
          end
        end
      end
    end
  end
end

Version data entries

69 entries across 69 versions & 7 rubygems

Version Path
geocoder-1.8.3 lib/geocoder/models/mongoid.rb
geocoder-1.8.2 lib/geocoder/models/mongoid.rb
geocoder-1.8.1 lib/geocoder/models/mongoid.rb
geocoder-1.8.0 lib/geocoder/models/mongoid.rb
geocoder-1.7.5 lib/geocoder/models/mongoid.rb
geocoder-1.7.4 lib/geocoder/models/mongoid.rb
geocoder-1.7.3 lib/geocoder/models/mongoid.rb
geocoder-1.7.2 lib/geocoder/models/mongoid.rb
geocoder-1.7.1 lib/geocoder/models/mongoid.rb
geocoder-1.7.0 lib/geocoder/models/mongoid.rb
geocoder-1.6.7 lib/geocoder/models/mongoid.rb
geocoder-1.6.6 lib/geocoder/models/mongoid.rb
geocoder-1.6.5 lib/geocoder/models/mongoid.rb
geocoder-1.6.4 lib/geocoder/models/mongoid.rb
geocoder-1.6.3 lib/geocoder/models/mongoid.rb
geocoder-1.6.2 lib/geocoder/models/mongoid.rb
geocoder-1.6.1 lib/geocoder/models/mongoid.rb
geocoder-1.6.0 lib/geocoder/models/mongoid.rb
geocoder-1.5.2 lib/geocoder/models/mongoid.rb
really-broken-geocoder-2.0.0 lib/geocoder/models/mongoid.rb