Sha256: f1896b11b47317432c791bf5c438e50d996e939dfcc7e5424b71761f2bf2d949

Contents?: true

Size: 598 Bytes

Versions: 54

Compression:

Stored size: 598 Bytes

Contents

class Chapter < ApplicationRecord
  include WithStats
  include WithNumber

  include FriendlyName

  include TopicContainer

  belongs_to :book, optional: true
  belongs_to :topic

  has_many :exercises, through: :topic

  include SiblingsNavigation
  include TerminalNavigation

  def used_in?(organization)
    organization.book == self.book
  end

  def pending_siblings_for(user)
    book.pending_chapters(user)
  end

  def index_usage!(organization = Organization.current)
    organization.index_usage_of! topic, self
    lessons.each { |lesson| lesson.index_usage! organization }
  end
end

Version data entries

54 entries across 54 versions & 2 rubygems

Version Path
mumuki-domain-6.4.2 app/models/chapter.rb
mumuki-domain-6.4.1 app/models/chapter.rb
mumuki-domain-6.4.0 app/models/chapter.rb
mumuki-domain-6.2.2 app/models/chapter.rb
mumuki-domain-6.2.1 app/models/chapter.rb
mumuki-domain-6.3.0 app/models/chapter.rb
mumuki-domain-6.2.0 app/models/chapter.rb
mumuki-domain-6.1.5 app/models/chapter.rb
mumuki-domain-6.0.4 app/models/chapter.rb
mumuki-domain-6.1.4 app/models/chapter.rb
mumuki-domain-6.1.3 app/models/chapter.rb
mumuki-domain-6.1.2 app/models/chapter.rb
mumuki-domain-6.0.3 app/models/chapter.rb
mumuki-domain-6.0.1 app/models/chapter.rb
mumuki-domain-6.0.0 app/models/chapter.rb
mumuki-laboratory-5.13.0 app/models/chapter.rb
mumuki-laboratory-5.12.1 app/models/chapter.rb
mumuki-laboratory-5.12.0 app/models/chapter.rb
mumuki-laboratory-5.11.0 app/models/chapter.rb
mumuki-laboratory-5.10.4 app/models/chapter.rb