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-laboratory-5.10.3 app/models/chapter.rb
mumuki-laboratory-5.10.2 app/models/chapter.rb
mumuki-laboratory-5.10.1 app/models/chapter.rb
mumuki-laboratory-5.10.0 app/models/chapter.rb
mumuki-laboratory-5.9.1 app/models/chapter.rb
mumuki-laboratory-5.9.0 app/models/chapter.rb
mumuki-laboratory-5.8.3 app/models/chapter.rb
mumuki-laboratory-5.8.1 app/models/chapter.rb
mumuki-laboratory-5.8.0 app/models/chapter.rb
mumuki-laboratory-5.7.0 app/models/chapter.rb
mumuki-laboratory-5.6.3 app/models/chapter.rb
mumuki-laboratory-5.6.2 app/models/chapter.rb
mumuki-laboratory-5.6.1 app/models/chapter.rb
mumuki-laboratory-5.6.0 app/models/chapter.rb