Skip to content

Commit

Permalink
Added a monkeypatch to get deleter_id to work.
Browse files Browse the repository at this point in the history
Fixed some failing tests.

modified:   app/models/project.rb
modified:   app/models/tag.rb
new file:   config/initializers/03_userstamp_monkeypatch.rb
modified:   config/initializers/secret_token.rb
modified:   db/schema.rb
modified:   spec/controllers/tags_controller_spec.rb
modified:   spec/factories/analysis_job_factory.rb
  • Loading branch information
Mark Cottman-Fields committed Feb 19, 2013
1 parent 5dcc462 commit 02b1697
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion app/models/tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 02b1697

Please sign in to comment.