Sha256: 5a71c8e1320f1c53d12c84793efca5204a5294a288bceb4a818089055c756d54

Contents?: true

Size: 934 Bytes

Versions: 11

Compression:

Stored size: 934 Bytes

Contents

require 'rubygems'
require 'test/unit'
require 'test_helper'
require 'mongoid'
require 'geocoder/models/mongoid'

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))

if (::Mongoid::VERSION >= "3")
  Mongoid.logger = Logger.new($stderr, :debug)
else
  Mongoid.configure do |config|
    config.logger = Logger.new($stderr, :debug)
  end
end

##
# Geocoded model.
#
class PlaceUsingMongoid
  include Mongoid::Document
  include Geocoder::Model::Mongoid

  geocoded_by :address, :coordinates => :location
  field :name
  field :address
  field :location, :type => Array

  def initialize(name, address)
    super()
    write_attribute :name, name
    write_attribute :address, address
  end
end

class PlaceUsingMongoidWithoutIndex
  include Mongoid::Document
  include Geocoder::Model::Mongoid

  field :location, :type => Array
  geocoded_by :location, :skip_index => true
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
geocoder-1.2.7 test/mongoid_test_helper.rb
geocoder-kb-1.2.6 test/mongoid_test_helper.rb
geocoder-1.2.6 test/mongoid_test_helper.rb
bw-geocoder-1.2.6 test/mongoid_test_helper.rb
bw-geocoder-1.2.5 test/mongoid_test_helper.rb
geocoder-1.2.5 test/mongoid_test_helper.rb
geocoder-1.2.4 test/mongoid_test_helper.rb
geocoder-1.2.3 test/mongoid_test_helper.rb
geocoder-1.2.2 test/mongoid_test_helper.rb
geocoder-1.2.1 test/mongoid_test_helper.rb
geocoder-1.2.0 test/mongoid_test_helper.rb