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-7.1.0 vendor/bundle/ruby/2.3.0/bundler/gems/mumuki-domain-925adf85cca8/app/models/chapter.rb
mumuki-domain-7.1.0 app/models/chapter.rb
mumuki-laboratory-7.0.12 vendor/bundle/ruby/2.3.0/bundler/gems/mumuki-domain-74da3d4af98c/app/models/chapter.rb
mumuki-domain-7.0.6 app/models/chapter.rb
mumuki-domain-7.0.5 app/models/chapter.rb
mumuki-domain-7.0.4 app/models/chapter.rb
mumuki-domain-7.0.3 app/models/chapter.rb
mumuki-laboratory-7.0.11 vendor/bundle/ruby/2.3.0/bundler/gems/mumuki-domain-f892f79c60f0/app/models/chapter.rb
mumuki-domain-7.0.2 app/models/chapter.rb
mumuki-domain-7.0.1 app/models/chapter.rb
mumuki-domain-7.0.0 app/models/chapter.rb
mumuki-domain-6.7.2 app/models/chapter.rb
mumuki-domain-6.7.1 app/models/chapter.rb
mumuki-domain-6.7.0 app/models/chapter.rb
mumuki-domain-6.6.2 app/models/chapter.rb
mumuki-domain-6.6.1 app/models/chapter.rb
mumuki-domain-6.6.0 app/models/chapter.rb
mumuki-domain-6.5.1 app/models/chapter.rb
mumuki-domain-6.5.0 app/models/chapter.rb
mumuki-domain-6.4.3 app/models/chapter.rb