Merge branch 'master' into glitch-soc/merge-upstream

This commit is contained in:
Thibaut Girka
2018-10-28 08:37:49 +01:00
44 changed files with 267 additions and 256 deletions

View File

@@ -148,6 +148,7 @@ class MediaAttachment < ApplicationRecord
"#{x},#{y}"
end
after_commit :reset_parent_cache, on: :update
before_create :prepare_description, unless: :local?
before_create :set_shortcode
before_post_process :set_type_and_extension
@@ -252,4 +253,9 @@ class MediaAttachment < ApplicationRecord
bitrate: movie.bitrate,
}
end
def reset_parent_cache
return if status_id.nil?
Rails.cache.delete("statuses/#{status_id}")
end
end