aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/active_storage
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/active_storage')
-rw-r--r--app/models/active_storage/variation.rb6
-rw-r--r--app/models/active_storage/verified_key_with_expiration.rb6
2 files changed, 4 insertions, 8 deletions
diff --git a/app/models/active_storage/variation.rb b/app/models/active_storage/variation.rb
index f7c81bb99a..b37397fcad 100644
--- a/app/models/active_storage/variation.rb
+++ b/app/models/active_storage/variation.rb
@@ -2,17 +2,15 @@ require "active_support/core_ext/object/inclusion"
# A set of transformations that can be applied to a blob to create a variant.
class ActiveStorage::Variation
- class_attribute :verifier
-
attr_reader :transformations
class << self
def decode(key)
- new verifier.verify(key)
+ new ActiveStorage.verifier.verify(key)
end
def encode(transformations)
- verifier.generate(transformations)
+ ActiveStorage.verifier.generate(transformations)
end
end
diff --git a/app/models/active_storage/verified_key_with_expiration.rb b/app/models/active_storage/verified_key_with_expiration.rb
index 4a46483db5..5cb07c6988 100644
--- a/app/models/active_storage/verified_key_with_expiration.rb
+++ b/app/models/active_storage/verified_key_with_expiration.rb
@@ -1,13 +1,11 @@
class ActiveStorage::VerifiedKeyWithExpiration
- class_attribute :verifier
-
class << self
def encode(key, expires_in: nil)
- verifier.generate([ key, expires_at(expires_in) ])
+ ActiveStorage.verifier.generate([ key, expires_at(expires_in) ])
end
def decode(encoded_key)
- key, expires_at = verifier.verified(encoded_key)
+ key, expires_at = ActiveStorage.verifier.verified(encoded_key)
key if key && fresh?(expires_at)
end