Sha256: 487e62d719324759e3ab820b13026067dde102e65c130cc6b0b05fb0233e62f7

Contents?: true

Size: 398 Bytes

Versions: 1

Compression:

Stored size: 398 Bytes

Contents

#
# Hood/Neighborhood
#
class Hood
  include Mongoid::Document

  field :gid,   type: Integer
  field :slug,  type: String
  field :name,  type: String, localize: true
  field :souls, type: Integer
  field :zip,   type: Integer
  field :rank,  type: Integer

  belongs_to :city

  validates  :city, :name, presence: true

  scope :ordered, order_by(name: 1)

  def to_s
    name || slug
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
geopolitical-0.8.2 app/models/hood.rb