diff --git a/app/models/post.rb b/app/models/post.rb index 598edf4..87661bd 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -1,5 +1,8 @@ class Post < ActiveRecord::Base belongs_to :feed + validates :title, :presence => true + validates :lat, :numericality => { :greater_than_or_equal_to => -90, :less_than_or_equal_to => 90 } + validates :lon, :numericality => { :greater_than_or_equal_to => -180, :less_than_or_equal_to => 180 } EARTH_RADIUS_METRES = 6378000