app/models/city.rb in geopolitical-0.9.7 vs app/models/city.rb in geopolitical-0.9.9
- old
+ new
@@ -16,11 +16,11 @@
belongs_to :region, inverse_of: :cities
belongs_to :nation, inverse_of: :cities
has_many :hoods
- has_one :nation_governancy, as: :nation_capital
- has_one :region_governancy, as: :region_capital
+ has_one :nation_governancy, as: :nation_capital, class_name: 'Nation'
+ has_one :region_governancy, as: :region_capital, class_name: 'Region'
before_validation :set_defaults, on: [:create]
validates :name, uniqueness: { scope: :region_id }
validate :region_inside_nation