Skip to content

Commit

Permalink
fix disable_attachments logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob committed Dec 2, 2024
1 parent c8c1d08 commit a8bea49
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/avo/fields/trix_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ def is_action_text?
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?
# Return the value of attachments_disabled if explicitly provided
return args[:attachments_disabled] unless args[:attachments_disabled].nil?

args[:attachments_disabled] == true
# Disable attachments if attachment_key is not present
args[:attachment_key].blank?
end
end
end
Expand Down

0 comments on commit a8bea49

Please sign in to comment.