Class: Course::Settings::ForumsComponent

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

Class Method Summary collapse

Instance Method Summary collapse

Methods included from EmailSettingsConcern

#email_settings, #update_email_setting

Class Method Details

.component_classObject


15
16
17
# File 'app/models/course/settings/forums_component.rb', line 15

def self.component_class
  Course::ForumsComponent
end

.email_setting_itemsObject


8
9
10
11
12
13
# File 'app/models/course/settings/forums_component.rb', line 8

def self.email_setting_items
  {
    post_replied: { enabled_by_default: true },
    topic_created: { enabled_by_default: true }
  }
end

Instance Method Details

#paginationInteger

Returns the forum pagination count


37
38
39
# File 'app/models/course/settings/forums_component.rb', line 37

def pagination
  settings.pagination || 50
end

#pagination=(count) ⇒ Object

Sets the forum pagination number


44
45
46
# File 'app/models/course/settings/forums_component.rb', line 44

def pagination=(count)
  settings.pagination = count
end

#titleString

Returns the title of forums component


22
23
24
# File 'app/models/course/settings/forums_component.rb', line 22

def title
  settings.title
end

#title=(title) ⇒ Object

Sets the title of forums component


29
30
31
32
# File 'app/models/course/settings/forums_component.rb', line 29

def title=(title)
  title = nil if title.blank?
  settings.title = title
end