From: Tom Hughes Date: Wed, 3 Jun 2020 16:31:12 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/pull/2641' X-Git-Tag: live~3194 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/a8c63724f64ef47e94ed739193314161bbdf9e1b?hp=1739bf6832886c86b5bf111608982b10f1965c47 Merge remote-tracking branch 'upstream/pull/2641' --- diff --git a/lib/consistency_validations.rb b/app/models/concerns/consistency_validations.rb similarity index 98% rename from lib/consistency_validations.rb rename to app/models/concerns/consistency_validations.rb index 7e9b33586..00c6ce993 100644 --- a/lib/consistency_validations.rb +++ b/app/models/concerns/consistency_validations.rb @@ -1,4 +1,6 @@ module ConsistencyValidations + extend ActiveSupport::Concern + # Generic checks that are run for the updates and deletes of # node, ways and relations. This code is here to avoid duplication, # and allow the extention of the checks without having to modify the diff --git a/lib/redactable.rb b/app/models/concerns/redactable.rb similarity index 57% rename from lib/redactable.rb rename to app/models/concerns/redactable.rb index 6efdae0ef..ccf04907f 100644 --- a/lib/redactable.rb +++ b/app/models/concerns/redactable.rb @@ -1,10 +1,8 @@ -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, -> { where(:redaction_id => nil) } + extend ActiveSupport::Concern + + included do + scope :unredacted, -> { where(:redaction_id => nil) } end def redacted?