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