class Locomotive::Wagon::ContentEntryWithOnlyRelationshipsDecorator

Public Instance Methods

__attributes__() click to toggle source
# File lib/locomotive/wagon/decorators/content_entry_decorator.rb, line 90
def __attributes__
  fields.associations.map { |f| f.name.to_sym }
end
decorate_belongs_to_field(value) click to toggle source
# File lib/locomotive/wagon/decorators/content_entry_decorator.rb, line 94
def decorate_belongs_to_field(value)
  return nil if value.nil?
  value._slug.try(:[], __locale__.to_s)
end
decorate_has_many_field(value) click to toggle source
# File lib/locomotive/wagon/decorators/content_entry_decorator.rb, line 111
def decorate_has_many_field(value)
  nil
end
decorate_many_to_many_field(value) click to toggle source
# File lib/locomotive/wagon/decorators/content_entry_decorator.rb, line 99
def decorate_many_to_many_field(value)
  entries = value.all

  if entries.empty?
    nil
  elsif entries.size == 1 && entries.first == ''
    [nil]
  else
    entries.map { |entry| entry._slug.try(:[], __locale__) }.compact
  end
end