Class: Decidim::Budgets::DownloadYourDataBudgetsOrderSerializer

Inherits:
Exporters::Serializer
  • Object
show all
Defined in:
app/serializers/decidim/budgets/download_your_data_budgets_order_serializer.rb

Instance Method Summary collapse

Constructor Details

#initialize(order) ⇒ DownloadYourDataBudgetsOrderSerializer

Public: Initializes the serializer with a conversation.



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

def initialize(order)
  @order = order
end

Instance Method Details

#serializeObject

Serializes a Debate for download your data



12
13
14
15
16
17
18
19
20
21
22
# File 'app/serializers/decidim/budgets/download_your_data_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