app/models/city.rb in geopolitical-1.0.2 vs app/models/city.rb in geopolitical-1.0.3
- old
+ new
@@ -4,12 +4,12 @@
class City
include Mongoid::Document
include Mongoid::Geospatial
include Geopolitocracy
- field :area, type: Integer # m2 square area
- field :geom, type: Point, spatial: true
+ field :area, type: Integer # m2 square area
+ field :geom, type: Point, spatial: true
# field :capital, type: String
spatial_scope :geom
attr_writer :x, :y, :z
@@ -41,10 +41,10 @@
def set_defaults
self.nation ||= region.try(:nation)
return unless City.where(slug: slug).first
self.slug += "-#{region.abbr}"
return unless City.where(slug: slug).first
- fail "Two cities with the same name in #{region}: '#{slug}'"
+ raise "Two cities with the same name in #{region}: '#{slug}'"
end
def phone
self[:phone] || region.phone || nation.phone
end