]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/note.rb
Mass rename of "bugs" as "notes" for increased user friendliness
[rails.git] / app / models / note.rb
similarity index 80%
rename from app/models/map_bug.rb
rename to app/models/note.rb
index 7094bfe5e7b983d373f0e8ef66d437d07f46c7c7..e36884ec16d32bd3bb6f1f59f6385b5d9fdd9c76 100644 (file)
@@ -1,8 +1,8 @@
-class MapBug < ActiveRecord::Base
+class Note < ActiveRecord::Base
   include GeoRecord
 
-  has_many :comments, :class_name => "MapBugComment",
-                      :foreign_key => :bug_id,
+  has_many :comments, :class_name => "NoteComment",
+                      :foreign_key => :note_id,
                       :order => :created_at,
                       :conditions => "visible = true AND body IS NOT NULL"
 
@@ -14,13 +14,13 @@ class MapBug < ActiveRecord::Base
   validates_inclusion_of :status, :in => ["open", "closed", "hidden"]
 
   def self.create_bug(lat, lon)
-    bug = MapBug.new(:lat => lat, :lon => lon, :status => "open")
-    raise OSM::APIBadUserInput.new("The node is outside this world") unless bug.in_world?
+    note = Note.new(:lat => lat, :lon => lon, :status => "open")
+    raise OSM::APIBadUserInput.new("The note is outside this world") unless note.in_world?
 
-    return bug
+    return note
   end
 
-  def close_bug
+  def close
     self.status = "closed"
     self.closed_at = Time.now.getutc