app/models/concerns/geopolitocracy.rb in geopolitical-0.8.8 vs app/models/concerns/geopolitocracy.rb in geopolitical-0.9.1
- old
+ new
@@ -1,17 +1,26 @@
# Geopolitical Helpers
module Geopolitocracy
extend ActiveSupport::Concern
included do
+ field :gid, type: Integer # geonames id
+
field :name, type: String, localize: true
field :abbr, type: String
field :nick, type: String
- field :gid, type: Integer # geonames id
+ field :souls, type: Integer # Population
+
field :ascii, type: String
field :code, type: String
field :slug, type: String # , default: -> { name }
+
+ field :postal, type: String # , default: -> { name }
+ field :phone, type: String # , default: -> { name }
+
+ alias_method :population, :souls
+ alias_method :iso_3166_2, :code
validates :name, presence: true
validates :slug, presence: true, uniqueness: true
index slug: 1