Sha256: a43f5cce4c89eb6873b9e380b0474fcdc2a6ef17fb4af0a9cc15eac2c3fa2c72

Contents?: true

Size: 360 Bytes

Versions: 12

Compression:

Stored size: 360 Bytes

Contents

# frozen_string_literal: true

module Lcms
  module Engine
    class Curriculum < ApplicationRecord
      has_many :resources, dependent: :nullify
      has_many :authors, -> { distinct }, through: :resources

      validates :name, :slug, presence: true, uniqueness: true

      def self.default
        where(default: true).first
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
lcms-engine-0.5.5 app/models/lcms/engine/curriculum.rb
lcms-engine-0.5.4 app/models/lcms/engine/curriculum.rb
lcms-engine-0.5.3 app/models/lcms/engine/curriculum.rb
lcms-engine-0.5.2 app/models/lcms/engine/curriculum.rb
lcms-engine-0.5.1 app/models/lcms/engine/curriculum.rb
lcms-engine-0.5.0 app/models/lcms/engine/curriculum.rb
lcms-engine-0.4.2 app/models/lcms/engine/curriculum.rb
lcms-engine-0.4.1 app/models/lcms/engine/curriculum.rb
lcms-engine-0.4.0 app/models/lcms/engine/curriculum.rb
lcms-engine-0.3.1 app/models/lcms/engine/curriculum.rb
lcms-engine-0.3.0 app/models/lcms/engine/curriculum.rb
lcms-engine-0.2.0 app/models/lcms/engine/curriculum.rb