Class: CourseTag
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- CourseTag
- Includes:
- RequiredUniqueName, RequiredUniqueSlug, Toggleable
- Defined in:
- app/models/course_tag.rb
Constant Summary collapse
- PER_PAGE =
20
- NAME_LIMIT =
50
- SLUG_LIMIT =
50
- SLUG_PATTERN =
/\A[a-z][-0-9a-z]*[0-9a-z]\z/i
- SLUG_PATTERN_HTML =
'^[a-zA-Z][-0-9a-zA-Z]*[0-9a-zA-Z]$'
Class Method Summary collapse
- .entity_parameters ⇒ Object
- .page_for_administration(page = 1) ⇒ Object
- .page_for_visitors(page = 1) ⇒ Object
Instance Method Summary collapse
Class Method Details
.entity_parameters ⇒ Object
38 39 40 |
# File 'app/models/course_tag.rb', line 38 def self.entity_parameters %i(visible image name slug) end |
.page_for_administration(page = 1) ⇒ Object
29 30 31 |
# File 'app/models/course_tag.rb', line 29 def self.page_for_administration(page = 1) ordered_by_name.page(page).per(PER_PAGE) end |
.page_for_visitors(page = 1) ⇒ Object
34 35 36 |
# File 'app/models/course_tag.rb', line 34 def self.page_for_visitors(page = 1) list_for_visitors.page(page).per(PER_PAGE) end |
Instance Method Details
#image_alt_text ⇒ Object
42 43 44 |
# File 'app/models/course_tag.rb', line 42 def image_alt_text name end |
#title ⇒ Object
46 47 48 |
# File 'app/models/course_tag.rb', line 46 def title name end |