Sha256: bc6622d090b0667b33803aab388851f045699174812afec9afe92f0ec518d9e5

Contents?: true

Size: 783 Bytes

Versions: 97

Compression:

Stored size: 783 Bytes

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

  def self.index_attributes
    %i[<%= SEARCHABLE_ATTRIBUTES -%>]
  end
end
<% end -%>

Version data entries

97 entries across 24 versions & 1 rubygems

Version Path
keppler-2.1.22 installer/core/rockets/keppler_languages/lib/generators/keppler_scaffold/templates/models/model.rb
keppler-2.1.22 installer/core/lib/plugins/generators/keppler_scaffold/templates/models/model.rb
keppler-2.1.22 installer/core/rockets/keppler_frontend/lib/generators/keppler_scaffold/templates/models/model.rb
keppler-2.1.22 installer/core/rockets/keppler_capsules/lib/rails/generators/active_record/model/templates/model.rb
keppler-2.1.21 installer/core/lib/plugins/generators/keppler_scaffold/templates/models/model.rb
keppler-2.1.21 installer/core/rockets/keppler_languages/lib/generators/keppler_scaffold/templates/models/model.rb
keppler-2.1.21 installer/core/rockets/keppler_capsules/lib/rails/generators/active_record/model/templates/model.rb
keppler-2.1.21 installer/core/rockets/keppler_frontend/lib/generators/keppler_scaffold/templates/models/model.rb
keppler-2.1.20 installer/core/rockets/keppler_languages/lib/generators/keppler_scaffold/templates/models/model.rb
keppler-2.1.20 installer/core/rockets/keppler_capsules/lib/rails/generators/active_record/model/templates/model.rb
keppler-2.1.20 installer/core/lib/plugins/generators/keppler_scaffold/templates/models/model.rb
keppler-2.1.20 installer/core/rockets/keppler_frontend/lib/generators/keppler_scaffold/templates/models/model.rb
keppler-2.1.19 installer/core/lib/plugins/generators/keppler_scaffold/templates/models/model.rb
keppler-2.1.19 installer/core/rockets/keppler_capsules/lib/rails/generators/active_record/model/templates/model.rb
keppler-2.1.19 installer/core/rockets/keppler_languages/lib/generators/keppler_scaffold/templates/models/model.rb
keppler-2.1.19 installer/core/rockets/keppler_frontend/lib/generators/keppler_scaffold/templates/models/model.rb
keppler-2.1.18 installer/core/rockets/keppler_frontend/lib/generators/keppler_scaffold/templates/models/model.rb
keppler-2.1.18 installer/core/lib/plugins/generators/keppler_scaffold/templates/models/model.rb
keppler-2.1.18 installer/core/rockets/keppler_languages/lib/generators/keppler_scaffold/templates/models/model.rb
keppler-2.1.18 testing-with-2.1.18/lib/plugins/generators/keppler_scaffold/templates/models/model.rb