Sha256: 869e82fbca9b4d4af3a9211d2a50456c6a3c177be9c6bc5dab1a4d700b003627

Contents?: true

Size: 433 Bytes

Versions: 5

Compression:

Stored size: 433 Bytes

Contents

require 'mongoid_geospatial'

module OnTheMap
  module Positionable
    extend ActiveSupport::Concern

    included do
      include Mongoid::Geospatial

      geo_field :position, :delegate => true

      spatial_index :position
      spatial_scope :position
    end

    def configure_positionable
    end

    protected

    def longitude= x
      position.x = x
    end

    def latitude= y
      position.y = y
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
on_the_map-0.1.5 lib/on_the_map/positionable.rb
on_the_map-0.1.4 lib/on_the_map/positionable.rb
on_the_map-0.1.3 lib/on_the_map/positionable.rb
on_the_map-0.1.1 lib/on_the_map/positionable.rb
on_the_map-0.1.0 lib/on_the_map/positionable.rb