Updated upload limits for pro accounts

This commit is contained in:
mgabdev 2019-09-17 01:13:25 -04:00
parent 6b4969dbdd
commit b340a49e5a
1 changed files with 7 additions and 2 deletions

View File

@ -83,8 +83,8 @@ class MediaAttachment < ApplicationRecord
},
}.freeze
IMAGE_LIMIT = 8.megabytes
VIDEO_LIMIT = 40.megabytes
IMAGE_LIMIT = Proc.new { |account| account.is_pro ? 50.megabytes : 8.megabytes }
VIDEO_LIMIT = Proc.new { |account| account.is_pro ? 1.gigabytes : 40.megabytes}
belongs_to :account, inverse_of: :media_attachments, optional: true
belongs_to :status, inverse_of: :media_attachments, optional: true
@ -112,6 +112,11 @@ class MediaAttachment < ApplicationRecord
default_scope { order(id: :asc) }
def is_pro
return false if account_id.nil?
account.is_pro
end
def local?
remote_url.blank?
end