Skip to content

Commit

Permalink
Make default of :attachments_disabled context-aware. (#2429)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrJoy authored Jan 30, 2024
1 parent 2192632 commit 5468f82
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/avo/fields/trix_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ def initialize(id, **args, &block)
hide_on :index

@always_show = args[:always_show] || false
@attachments_disabled = args[:attachments_disabled] || 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 = args[:attachments_disabled] || true
@attachments_disabled = false unless @attachment_key.present?
@hide_attachment_filename = args[:hide_attachment_filename] || false
@hide_attachment_filesize = args[:hide_attachment_filesize] || false
@hide_attachment_url = args[:hide_attachment_url] || false
Expand Down

0 comments on commit 5468f82

Please sign in to comment.