]> git.openstreetmap.org Git - rails.git/commitdiff
Fix mass assignment issues
authorTom Hughes <tom@compton.nu>
Fri, 9 Mar 2012 00:34:16 +0000 (00:34 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 9 Mar 2012 00:34:16 +0000 (00:34 +0000)
app/controllers/note_controller.rb
app/models/note.rb

index 4c0c98b6320257027a647149ed4f169dc7639d25..4c6ede6bea9cf082ad4a3fa308193287b4f778f7 100644 (file)
@@ -344,7 +344,7 @@ private
       attributes[:author_name] = name + " (a)"
     end
 
       attributes[:author_name] = name + " (a)"
     end
 
-    note.comments.create(attributes)
+    note.comments.create(attributes, :without_protection => true)
 
     note.comments.map { |c| c.author }.uniq.each do |user|
       if user and user != @user
 
     note.comments.map { |c| c.author }.uniq.each do |user|
       if user and user != @user
index 9531e2899758b65204b3e9c459d1cce909d1d651..c32b1679b07b593f1dab2c8e9045e48cb1796e71 100644 (file)
@@ -14,6 +14,8 @@ class Note < ActiveRecord::Base
   validates_inclusion_of :status, :in => ["open", "closed", "hidden"]
   validate :validate_position
 
   validates_inclusion_of :status, :in => ["open", "closed", "hidden"]
   validate :validate_position
 
+  attr_accessible :lat, :lon
+
   after_initialize :set_defaults
 
   # Sanity check the latitude and longitude and add an error if it's broken
   after_initialize :set_defaults
 
   # Sanity check the latitude and longitude and add an error if it's broken