Sha256: 741e67f4160f03854caf9c22cc6105bc6685fcbf9f404f42c87c1f42eda06fd4

Contents?: true

Size: 553 Bytes

Versions: 12

Compression:

Stored size: 553 Bytes

Contents

module Cmor::Files
  class FileDetail < ApplicationRecord
    belongs_to :folder
    belongs_to :asset, class_name: 'ActiveStorage::Attachment', dependent: :destroy

    # acts as published
    include ActsAsPublished::ActiveRecord
    acts_as_published

    # acts as list
    acts_as_list scope: :folder
    default_scope { order(folder_id: :desc, position: :asc) }

    # slugs
    extend FriendlyId
    friendly_id :title, use: :slugged

    validates :identifier, uniqueness: { scope: [ :folder_id ] }, allow_blank: true, allow_nil: true
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
cmor_files-0.0.58.pre app/models/cmor/files/file_detail.rb
cmor_files-0.0.57.pre app/models/cmor/files/file_detail.rb
cmor_files-0.0.56.pre app/models/cmor/files/file_detail.rb
cmor_files-0.0.55.pre app/models/cmor/files/file_detail.rb
cmor_files-0.0.54.pre app/models/cmor/files/file_detail.rb
cmor_files-0.0.53.pre app/models/cmor/files/file_detail.rb
cmor_files-0.0.52.pre app/models/cmor/files/file_detail.rb
cmor_files-0.0.51.pre app/models/cmor/files/file_detail.rb
cmor_files-0.0.50.pre app/models/cmor/files/file_detail.rb
cmor_files-0.0.49.pre app/models/cmor/files/file_detail.rb
cmor_files-0.0.48.pre app/models/cmor/files/file_detail.rb
cmor_files-0.0.45.pre app/models/cmor/files/file_detail.rb