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. It also adds the created_at value of the instance.
16 17 18 19 20 21 22 23 |
# File 'app/models/locomotive/extensions/content_entry/csv.rb', line 16 def to_values( = {}) 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 values << I18n.l(self.created_at, format: :long) end |