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

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.

Parameters:

  • options (Hash) (defaults to: {})

    For now, stores only the host for the File fields.

Returns:

  • (Array)


15
16
17
18
19
20
# File 'app/models/locomotive/extensions/content_entry/csv.rb', line 15

def to_values(options = {})
  self.content_type.ordered_entries_custom_fields.map do |field|
    value = self.send(field.name)
    self.value_from_type(field.type.to_sym, value, options)
  end.compact
end