diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2018-03-03 21:36:43 +0100 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2018-03-03 21:36:43 +0100 |
commit | 0f302b897022b68793e102efa90a2819ff4e107a (patch) | |
tree | 8db635773878ae88556162cc34ecc244c83cb7b8 /activestorage/app/models | |
parent | 6932998fc7aecba6ade04f8d799f07b494dd402c (diff) | |
download | rails-0f302b897022b68793e102efa90a2819ff4e107a.tar.gz rails-0f302b897022b68793e102efa90a2819ff4e107a.tar.bz2 rails-0f302b897022b68793e102efa90a2819ff4e107a.zip |
Merge Previews/Variants controller into one Representations controller.
Since ActiveStorage::Blob::Representable unifies the idea of previews and
variants under one roof as representation, we may as well have the
controllers follow suit.
Thus ActiveStorage::RepresenationsController enters the fray. I've copied
the old tests for both previews and variants and unified those as well.
Diffstat (limited to 'activestorage/app/models')
-rw-r--r-- | activestorage/app/models/active_storage/blob/representable.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activestorage/app/models/active_storage/blob/representable.rb b/activestorage/app/models/active_storage/blob/representable.rb index 0ad2e2fd77..88fc25b7ae 100644 --- a/activestorage/app/models/active_storage/blob/representable.rb +++ b/activestorage/app/models/active_storage/blob/representable.rb @@ -27,7 +27,7 @@ module ActiveStorage::Blob::Representable # variable, call ActiveStorage::Blob#variable?. def variant(transformations) if variable? - ActiveStorage::Variant.new(self, ActiveStorage::Variation.wrap(transformations)) + ActiveStorage::Variant.new(self, transformations) else raise ActiveStorage::InvariableError end @@ -55,7 +55,7 @@ module ActiveStorage::Blob::Representable # whether a blob is accepted by any previewer, call ActiveStorage::Blob#previewable?. def preview(transformations) if previewable? - ActiveStorage::Preview.new(self, ActiveStorage::Variation.wrap(transformations)) + ActiveStorage::Preview.new(self, transformations) else raise ActiveStorage::UnpreviewableError end |