Class: Decidim::Budgets::DataPortabilityBudgetsOrderSerializer

Inherits:
Exporters::Serializer show all
Defined in:
decidim-budgets/app/serializers/decidim/budgets/data_portability_budgets_order_serializer.rb

Instance Method Summary collapse

Methods inherited from Exporters::Serializer

#event_name, #finalize, #run

Constructor Details

#initialize(order) ⇒ DataPortabilityBudgetsOrderSerializer

Public: Initializes the serializer with a conversation.


7
8
9
# File 'decidim-budgets/app/serializers/decidim/budgets/data_portability_budgets_order_serializer.rb', line 7

def initialize(order)
  @order = order
end

Instance Method Details

#serializeObject

Serializes a Debate for data portability


12
13
14
15
16
17
18
19
20
21
22
# File 'decidim-budgets/app/serializers/decidim/budgets/data_portability_budgets_order_serializer.rb', line 12

def serialize
  {
    id: order.id,
    budget: order.budget.title,
    component: order.budget.component.name,
    checked_out_at: order.checked_out_at,
    projects: all_projects,
    created_at: order.created_at,
    updated_at: order.updated_at
  }
end