X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/0d3a9ed9cb47ce3b89ea9eaffbb589f9a9ff6d22..ea4e33efa8b81b6f3183ee94abf7464d5b42490f:/lib/redactable.rb diff --git a/lib/redactable.rb b/lib/redactable.rb index d8367d7bd..a42164ec7 100644 --- a/lib/redactable.rb +++ b/lib/redactable.rb @@ -1,19 +1,19 @@ -require 'osm' +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) + base.scope :unredacted, -> { base.where(:redaction_id => nil) } end - + def redacted? - not self.redaction.nil? + !redaction.nil? end def redact!(redaction) # check that this version isn't the current version - raise OSM::APICannotRedactError.new if self.is_latest_version? + fail OSM::APICannotRedactError.new if self.is_latest_version? # make the change self.redaction = redaction