Updated upload limits for pro accounts
This commit is contained in:
parent
6b4969dbdd
commit
b340a49e5a
@ -83,8 +83,8 @@ class MediaAttachment < ApplicationRecord
|
|||||||
},
|
},
|
||||||
}.freeze
|
}.freeze
|
||||||
|
|
||||||
IMAGE_LIMIT = 8.megabytes
|
IMAGE_LIMIT = Proc.new { |account| account.is_pro ? 50.megabytes : 8.megabytes }
|
||||||
VIDEO_LIMIT = 40.megabytes
|
VIDEO_LIMIT = Proc.new { |account| account.is_pro ? 1.gigabytes : 40.megabytes}
|
||||||
|
|
||||||
belongs_to :account, inverse_of: :media_attachments, optional: true
|
belongs_to :account, inverse_of: :media_attachments, optional: true
|
||||||
belongs_to :status, 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) }
|
default_scope { order(id: :asc) }
|
||||||
|
|
||||||
|
def is_pro
|
||||||
|
return false if account_id.nil?
|
||||||
|
account.is_pro
|
||||||
|
end
|
||||||
|
|
||||||
def local?
|
def local?
|
||||||
remote_url.blank?
|
remote_url.blank?
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user