Class: Course::Settings::LessonPlanComponent

Inherits:
Component
  • Object
show all
Includes:
ActiveModel::Conversion
Defined in:
app/models/course/settings/lesson_plan_component.rb

Constant Summary collapse

MILESTONES_EXPANDED_VALUES =
%w[all none current].freeze

Instance Method Summary collapse

Instance Method Details

#milestones_expandedString

Returns the setting which controls which milestones groups are expanded when the lesson plan page is first loaded.


11
# File 'app/models/course/settings/lesson_plan_component.rb', line 11

delegate :milestones_expanded, to: :settings

#milestones_expanded=(setting) ⇒ String

Sets which milestones groups are expanded when the lesson plan page is first loaded.

Raises:

  • (ArgumentError)

16
17
18
19
20
21
# File 'app/models/course/settings/lesson_plan_component.rb', line 16

def milestones_expanded=(setting)
  raise ArgumentError, 'Invalid lesson plan milestone groups expanded setting.' \
    unless MILESTONES_EXPANDED_VALUES.include?(setting)

  settings.milestones_expanded = setting
end