Sha256: 8662e14625a68e06954e58fabf81055b1d6bd9c42fd37ab48df226e6df87959c

Contents?: true

Size: 324 Bytes

Versions: 1

Compression:

Stored size: 324 Bytes

Contents

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

  field :souls, type: Integer
  field :rank,  type: Integer
  field :zip,   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.4 app/models/hood.rb