diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-09-01 16:20:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-01 16:20:16 +0200 |
commit | 7dc5035031a697e7a2726fcd787fc9c294751027 (patch) | |
tree | ad2e2fe24ba604c07e4c329315efdf1479759cc8 /app/models/media_attachment.rb | |
parent | 2305f7c391325c7abf8746ebb2bb560c13df4437 (diff) |
Make PreviewCard records reuseable between statuses (#4642)
* Make PreviewCard records reuseable between statuses **Warning!** Migration truncates preview_cards tablec * Allow a wider thumbnail for link preview, display it in horizontal layout (#4648) * Delete preview cards files before truncating * Rename old table instead of truncating it * Add mastodon:maintenance:remove_deprecated_preview_cards * Ignore deprecated_preview_cards in schema definition * Fix null behaviour
Diffstat (limited to 'app/models/media_attachment.rb')
-rw-r--r-- | app/models/media_attachment.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb index 1e8c6d00a..d83ca44f1 100644 --- a/app/models/media_attachment.rb +++ b/app/models/media_attachment.rb @@ -142,9 +142,11 @@ class MediaAttachment < ApplicationRecord def populate_meta meta = {} + file.queued_for_write.each do |style, file| begin geo = Paperclip::Geometry.from_file file + meta[style] = { width: geo.width.to_i, height: geo.height.to_i, @@ -155,6 +157,7 @@ class MediaAttachment < ApplicationRecord meta[style] = {} end end + meta end |