Add uniqueness constraint on city_id

This commit is contained in:
Erik Michaels-Ober 2012-01-27 13:11:44 -08:00
parent 75ee2ab31d
commit b311063ed7
1 changed files with 1 additions and 0 deletions

View File

@ -1,5 +1,6 @@
class Thing < ActiveRecord::Base class Thing < ActiveRecord::Base
include Geokit::Geocoders include Geokit::Geocoders
validates_uniqueness_of :city_id, :allow_nil => true
validates_presence_of :lat, :lng validates_presence_of :lat, :lng
belongs_to :user belongs_to :user
has_many :reminders has_many :reminders