Sha256: 6b9122c42676afadb9afb96dc58e273a017adf084474791a600a082e83afa571

Contents?: true

Size: 569 Bytes

Versions: 1

Compression:

Stored size: 569 Bytes

Contents

# Locating 是地理定位,表示地理位置和被定位物体之间的关联。

class Unidom::Geo::Location < ActiveRecord::Base

  self.table_name = 'unidom_locatings'

  belongs_to :location, class_name: 'Unidom::Geo::Location'
  belongs_to :located,  polymorphic: true
  belongs_to :locator,  polymorphic: true

  scope :location_is, ->(location) { where location: location }
  scope :located_is,  ->(located)  { where located:  located  }
  scope :located_by,  ->(locator)  { where locator:  locator  }

  include Unidom::Common::Concerns::ModelExtension

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
unidom-geo-0.2 app/models/unidom/geo/locating.rb