Skip to content

Commit

Permalink
Update comment
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierbuffon committed Feb 7, 2024
1 parent f3c8221 commit 6f92d12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/avo/fields/trix_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ def initialize(id, **args, &block)

@always_show = args[:always_show] || false
@attachment_key = args[:attachment_key]
# If we don't have an attachment_key, we disable attachments. There's no point in having
# attachments if we can't store them.
@attachments_disabled = disable_attachments?(args)
@hide_attachment_filename = args[:hide_attachment_filename] || false
@hide_attachment_filesize = args[:hide_attachment_filesize] || false
Expand All @@ -26,6 +24,8 @@ def initialize(id, **args, &block)
private

def disable_attachments?(args)
# If we don't have an attachment_key, we disable attachments. There's no point in having
# attachments if we can't store them.
return false if args[:attachment_key].present?

args[:attachments_disabled] == true
Expand Down

0 comments on commit 6f92d12

Please sign in to comment.