Sha256: f54fb7bb9fd700877e4de6c8cdd3fe319e870a8cc725b11550e5c0ccf9904715

Contents?: true

Size: 374 Bytes

Versions: 2

Compression:

Stored size: 374 Bytes

Contents

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

2 entries across 2 versions & 1 rubygems

Version Path
geopolitical-0.8.1 app/models/hood.rb
geopolitical-0.8.0 app/models/hood.rb