Sha256: f860b41dc4cbadd3fb1cda23ed3b19c300a3cb88c32d7a63da55723c1ff4938f
Contents?: true
Size: 653 Bytes
Versions: 44
Compression:
Stored size: 653 Bytes
Contents
# frozen_string_literal: true module Decidim # A module to deal with attributes associated with attachments allowing # deletions with remove_attribute_name module AttachmentAttributesMethods private # This method set the attributes to assign. The attribute is included if a # value exists in the form or remove_[attribute_name] is true in the form # (in this case the value is nil) def attachment_attributes(*attrs) attrs.each_with_object({}) do |attribute, attributes| attributes[attribute] = form.send(attribute) if form.try("remove_#{attribute}") || form.send(attribute).present? end end end end
Version data entries
44 entries across 44 versions & 1 rubygems