Module: Locomotive::Extensions::ContentEntry::Csv
- Extended by:
- ActiveSupport::Concern
- Included in:
- ContentEntry
- Defined in:
- app/models/locomotive/extensions/content_entry/csv.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#to_values(options = {}) ⇒ Array
Get the values from the custom fields as an array.
Instance Method Details
#to_values(options = {}) ⇒ Array
Get the values from the custom fields as an array. Values are ordered by the position of the custom fields.
15 16 17 18 19 20 |
# File 'app/models/locomotive/extensions/content_entry/csv.rb', line 15 def to_values( = {}) self.content_type.ordered_entries_custom_fields.map do |field| value = self.send(field.name) self.value_from_type(field.type.to_sym, value, ) end.compact end |