Class: Maglev::Site
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Maglev::Site
- Includes:
- SectionsConcern, LocalesConcern, Translatable
- Defined in:
- app/models/maglev/site.rb
Defined Under Namespace
Modules: LocalesConcern Classes: Locale, StyleValue
Instance Method Summary collapse
-
#api_attributes ⇒ Object
methods ##.
- #find_section(type) ⇒ Object
-
#name ⇒ Object
validations ##.
-
#sections ⇒ Object
translations ##.
Methods included from Translatable
Methods included from SectionsConcern
#prepare_sections, #prepare_sections_translations
Methods included from LocalesConcern
#default_locale, #default_locale_prefix, #each_locale, #locale_prefixes
Instance Method Details
#api_attributes ⇒ Object
methods ##
17 18 19 |
# File 'app/models/maglev/site.rb', line 17 def api_attributes %i[id name] end |
#find_section(type) ⇒ Object
21 22 23 |
# File 'app/models/maglev/site.rb', line 21 def find_section(type) sections&.find { |section| section['type'] == type } end |
#name ⇒ Object
validations ##
14 |
# File 'app/models/maglev/site.rb', line 14 validates :name, presence: true |
#sections ⇒ Object
translations ##
11 |
# File 'app/models/maglev/site.rb', line 11 translates :sections |