Class: Formats::Service
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Formats::Service
- Includes:
- TranslationCms::WhiteList
- Defined in:
- app/models/formats/service.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.sunrise_search(params) ⇒ Object
35 36 37 38 39 |
# File 'app/models/formats/service.rb', line 35 def sunrise_search(params) q = normal q = q.where('title LIKE ?', "%#{params[:title]}%") if params[:title].present? q end |
Instance Method Details
#color_theme ⇒ Object
23 24 25 |
# File 'app/models/formats/service.rb', line 23 def color_theme Formats::ColorTheme.find(color_theme_id) end |
#default_category ⇒ Object
29 30 31 32 |
# File 'app/models/formats/service.rb', line 29 def default_category @default_category ||= Category.find_by(id: default_category_id) || categories.build(title: title.try(:upcase)) end |