Sha256: 8f9035894b666afa5e4e720f134225b4dae1cdcf9ac561c050efe504ba0e8924
Contents?: true
Size: 1.03 KB
Versions: 4
Compression:
Stored size: 1.03 KB
Contents
# frozen_string_literal: true <% module_namespacing do -%> # <%= class_name %> Model class <%= class_name %> < ApplicationRecord include ActivityHistory include CloneRecord include Uploadable include Downloadable include Sortable include Searchable <%- attributes.each do |attribute| -%> <%- if @singular_attachments.include?(attribute.name) -%> mount_uploader :<%=attribute.name%>, AttachmentUploader <%- elsif @plural_attachments.include?(attribute.name) -%> mount_uploaders :<%=attribute.name%>, AttachmentUploader <%- end -%> <%- if attribute.reference? -%> belongs_to :<%= attribute.name %> <%- end -%> <%- end -%> acts_as_list acts_as_paranoid # Begin validations area (don't delete) # End validations area (don't delete def self.index_attributes %i[<%= attributes.select { |k,v| @singular_attachments.exclude?(k) && @plural_attachments.exclude?(k) && %w[string text integer].include?(v) && %w[position].exclude?(k) && k.exclude?('-') }.map(&:first).join(' ') -%>] end end <% end -%>
Version data entries
4 entries across 4 versions & 1 rubygems