Class: Cms9::PostDefinition
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Cms9::PostDefinition
- Defined in:
- app/models/cms9/post_definition.rb
Instance Method Summary collapse
-
#field(name) ⇒ Object
Get field by name.
- #fields ⇒ Object
Instance Method Details
#field(name) ⇒ Object
Get field by name
19 20 21 22 |
# File 'app/models/cms9/post_definition.rb', line 19 def field(name) fields() @cache_fields[name] end |
#fields ⇒ Object
10 11 12 13 14 15 16 |
# File 'app/models/cms9/post_definition.rb', line 10 def fields if @cache_fields.nil? @cache_fields = self.post_fields.map { |field| [field.name, field] }.to_h end @cache_fields.values end |