app/models/zone.rb in geopolitical-0.8.1 vs app/models/zone.rb in geopolitical-0.8.2
- old
+ new
@@ -1,19 +1,20 @@
+#
+# User created zones
class Zone
include Mongoid::Document
field :gid, type: Integer # geonames id
field :slug, type: String
field :name, type: String, localize: true
field :abbr, type: String
field :kind, type: String
- has_many :zone_members, :dependent => :destroy
+ has_many :zone_members, dependent: :destroy
scope :ordered, order_by(name: 1)
validates :name, presence: true, uniqueness: true
-
def members
zone_members.map(&:member)
end