Sha256: cd3e04c868838766115da7b3290fb1d978c4db3e68a8a90025d5db1813984f5f
Contents?: true
Size: 431 Bytes
Versions: 6
Compression:
Stored size: 431 Bytes
Contents
# # Hood/Neighborhood # class Hood include Mongoid::Document include Geopolitocracy field :rank, type: Integer belongs_to :city validates :city, presence: true validates :name, uniqueness: { scope: :city_id } def phone self[:phone] || city.phone end def postal self[:postal] || city.postal end def as_json(_opts = {}) { id: id.to_s, name: name, city: city } end end
Version data entries
6 entries across 6 versions & 1 rubygems