diff --git a/app/models/project.rb b/app/models/project.rb index b1ed71e8..4f6351e7 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -13,7 +13,8 @@ class Project < ActiveRecord::Base # attr # http://stackoverflow.com/questions/4934194/resulttype-614051528-expected-got-string-608366078-with-many-to-many-as - attr_accessible :description, :name, :urn, :notes, :site_ids, :photos_attributes # :sites, :sites_attributes (those damn s's!) + attr_accessible :description, :name, :urn, :notes, :latitude, :longitude, + :site_ids, :photos_attributes # :sites, :sites_attributes (those damn s's!) # userstamp @@ -25,6 +26,8 @@ class Project < ActiveRecord::Base # validation validates :name, :presence => true, :uniqueness => { :case_sensitive => false } validates :urn, :presence => true, :uniqueness => { :case_sensitive => false } + validates :latitude, :numericality => true + validates :longitude, :numericality => true validates_format_of :urn, :with => /^urn:[a-z0-9][a-z0-9-]{0,31}:[a-z0-9()+,\-.:=@;$_!*'%\/?#]+$/ # commonly used queries (these return diff --git a/app/models/tag.rb b/app/models/tag.rb index 5c3a34bf..d80dbcf3 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -7,7 +7,7 @@ class Tag < ActiveRecord::Base accepts_nested_attributes_for :audio_events # attr - attr_accessible :is_taxanomic, :text, :type_of_tag + attr_accessible :is_taxanomic, :text, :type_of_tag, :retired, :notes # userstamp stampable @@ -21,6 +21,7 @@ class Tag < ActiveRecord::Base # validation validates :is_taxanomic, inclusion: { in: [true, false] } validates :text, uniqueness: { case_sensitive: false } + validates :retired, inclusion: { in: [true, false] } validate :no_nils