Class: Course::Settings::Component

Inherits:
SimpleDelegator
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
app/models/course/settings/component.rb

Overview

This serves as a base class for course settings models that are associated with a course component.

Instance Method Summary collapse

Instance Method Details

#persisted?Boolean

TODO: Remove once all setting forms have been ported to React

Returns:

  • (Boolean)

18
19
20
# File 'app/models/course/settings/component.rb', line 18

def persisted?
  true
end

#update(attributes) ⇒ Object

Update settings with the hash attributes

Parameters:

  • attributes (Hash)

    The hash for the new settings


12
13
14
15
# File 'app/models/course/settings/component.rb', line 12

def update(attributes)
  attributes.each { |k, v| send("#{k}=", v) }
  valid?
end