Sha256: 2b839cbd6c868f4173cf431ab6dd2a84fc069ed9d5237a6502aecd7d18077324

Contents?: true

Size: 660 Bytes

Versions: 14

Compression:

Stored size: 660 Bytes

Contents

module Cmor
  module Core
    module Model
      module CollectionConcern
        extend ActiveSupport::Concern

        included do
          include Cmor::Core::Model::LocalizationConcern
          include Cmor::Core::Model::IdentifierConcern

          # acts as published
          include ActsAsPublished::ActiveRecord
          acts_as_published

          # acts as list
          acts_as_list
          default_scope { order(position: :asc) }

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

          validates :name, presence: true, uniqueness: { scope: [ :locale ] }
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
cmor_core-0.0.60.pre lib/cmor/core/model/collection_concern.rb
cmor_core-0.0.59.pre lib/cmor/core/model/collection_concern.rb
cmor_core-0.0.58.pre lib/cmor/core/model/collection_concern.rb
cmor_core-0.0.57.pre lib/cmor/core/model/collection_concern.rb
cmor_core-0.0.56.pre lib/cmor/core/model/collection_concern.rb
cmor_core-0.0.55.pre lib/cmor/core/model/collection_concern.rb
cmor_core-0.0.54.pre lib/cmor/core/model/collection_concern.rb
cmor_core-0.0.53.pre lib/cmor/core/model/collection_concern.rb
cmor_core-0.0.52.pre lib/cmor/core/model/collection_concern.rb
cmor_core-0.0.51.pre lib/cmor/core/model/collection_concern.rb
cmor_core-0.0.50.pre lib/cmor/core/model/collection_concern.rb
cmor_core-0.0.49.pre lib/cmor/core/model/collection_concern.rb
cmor_core-0.0.48.pre lib/cmor/core/model/collection_concern.rb
cmor_core-0.0.45.pre lib/cmor/core/model/collection_concern.rb