Class: Lesson

Inherits:
ApplicationRecord show all
Includes:
FriendlyName, GuideContainer, ParentNavigation, SiblingsNavigation, WithNumber
Defined in:
app/models/lesson.rb

Instance Method Summary collapse

Methods included from GuideContainer

#attempts_left_for, #friendly, #index_usage!, #limited_for?, #resettable?, #results_hidden_for?, #start!, #timed?, #validate_accessible_for!

Methods included from Container

#content_used_in?, #navigable_content_in, #progress_for

Methods included from ParentNavigation

#leave, #navigable_name, #navigable_parent, #navigation_end?

Methods included from SiblingsNavigation

#navigable_name, #next_for, #restart, #siblings

Methods included from FriendlyName

#friendly_name, #to_param

Methods inherited from ApplicationRecord

active_between, aggregate_of, all_except, defaults, #delete, #destroy!, enum_prefixed_translations_for, numbered, organic_on, resource_fields, #save, #save_and_notify!, #save_and_notify_changes!, serialize_symbolized_hash_array, teaser_on, #update_and_notify!, update_or_create!, whitelist_attributes, with_pg_retry, with_temporary_token

Methods included from WithPgLock

#with_pg_lock

Instance Method Details

#pending_siblings_for(user) ⇒ Object



21
22
23
# File 'app/models/lesson.rb', line 21

def pending_siblings_for(user)
  topic.pending_lessons(user)
end

#structural_parentObject



17
18
19
# File 'app/models/lesson.rb', line 17

def structural_parent
  topic
end

#used_in?(organization) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'app/models/lesson.rb', line 13

def used_in?(organization)
  guide.usage_in_organization(organization) == self
end