app/services/serializers/serialize_order_history.rb
# Adds both native attributes and values generated from instance methods
Adds both native attributes and values generated from instance methods
Adds both native attributes and values generated from instance methods
def add_attributes
    atts = [
      :id, :access_date_start, :access_date_end, :order_type_id, :confirmed,
      :open, :created_at, :updated_at, :history
    ]
    atts.each do |a|
      case a
      when :created_at, :updated_at, :access_date_start, :access_date_end
        value = @record.send(a)
        value = format_datetime_value(value)
      else
        value = @record.send(a)
      end
      @response[:order][a] = value if value
    end
  end
def add_attributes atts = [ :id , :access_date_start , :access_date_end , :order_type_id , :confirmed , :open , :created_at , :updated_at , :history ] atts . each do | a | case a when :created_at , :updated_at , :access_date_start , :access_date_end value = @record . send ( a ) value = format_datetime_value ( value ) else value = @record . send ( a ) end @response [ :order ] [ a ] = value if value end end
Adds both native attributes and values generated from instance methods
Adds both native attributes and values generated from instance methods