X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/2063fc98f185e68bc655b79f6d75010ad2a6b9b3..67dd9e4c9d487bdb5f38a09dc0c99def4989326e:/lib/redactable.rb diff --git a/lib/redactable.rb b/lib/redactable.rb new file mode 100644 index 000000000..b994e8563 --- /dev/null +++ b/lib/redactable.rb @@ -0,0 +1,15 @@ +require 'osm' + +module Redactable + def redacted? + not self.redaction.nil? + end + + def redact!(redaction) + # check that this version isn't the current version + raise OSM::APICannotRedactError.new if self.is_latest_version? + + # make the change + self.redaction = redaction + end +end