]> git.openstreetmap.org Git - rails.git/blobdiff - lib/redactable.rb
Fix gap for iconless nodes in history view
[rails.git] / lib / redactable.rb
index b994e8563ab31e2934286d054533b0e2a555f712..d8367d7bdf766741aa9b57a244a16c92786e4885 100644 (file)
@@ -1,6 +1,12 @@
 require 'osm'
 
 module Redactable
+  def self.included(base)
+    # this is used to extend activerecord bases, as these aren't
+    # in scope for the module itself.
+    base.scope :unredacted, base.where(:redaction_id => nil)
+  end
+  
   def redacted?
     not self.redaction.nil?
   end
@@ -11,5 +17,6 @@ module Redactable
 
     # make the change
     self.redaction = redaction
+    self.save!
   end
 end