Sha256: 8fe27bc38e994304658e0708b18c85111d923c934e0743138107e1ca0808d57d

Contents?: true

Size: 558 Bytes

Versions: 20

Compression:

Stored size: 558 Bytes

Contents

class Chapter < ApplicationRecord
  include WithStats
  include WithNumber

  include FriendlyName

  include TopicContainer

  belongs_to :book, optional: true
  belongs_to :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

20 entries across 20 versions & 1 rubygems

Version Path
mumuki-laboratory-5.5.0 app/models/chapter.rb
mumuki-laboratory-5.4.0 app/models/chapter.rb
mumuki-laboratory-5.3.0 app/models/chapter.rb
mumuki-laboratory-5.2.1 app/models/chapter.rb
mumuki-laboratory-5.2.0 app/models/chapter.rb
mumuki-laboratory-5.1.1 app/models/chapter.rb
mumuki-laboratory-5.1.0 app/models/chapter.rb
mumuki-laboratory-5.0.12 app/models/chapter.rb
mumuki-laboratory-5.0.11 app/models/chapter.rb
mumuki-laboratory-5.0.10 app/models/chapter.rb
mumuki-laboratory-5.0.9 app/models/chapter.rb
mumuki-laboratory-5.0.8 app/models/chapter.rb
mumuki-laboratory-5.0.7 app/models/chapter.rb
mumuki-laboratory-5.0.6 app/models/chapter.rb
mumuki-laboratory-5.0.5 app/models/chapter.rb
mumuki-laboratory-5.0.4 app/models/chapter.rb
mumuki-laboratory-5.0.3 app/models/chapter.rb
mumuki-laboratory-5.0.2 app/models/chapter.rb
mumuki-laboratory-5.0.1 app/models/chapter.rb
mumuki-laboratory-5.0.0 app/models/chapter.rb