Skip to content

Commit

Permalink
Add fixes from 0.25
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreMesure committed Jun 6, 2022
1 parent b60c656 commit 3e5d279
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ module Decidim
module BudgetsPaperBallots
# The data store for a paper ballot result in the Budget resource.
class PaperBallotResult < Budgets::ApplicationRecord
include Decidim::Resourceable

self.table_name = "decidim_budgets_paper_ballot_results"
belongs_to :project, class_name: "Decidim::Budgets::Project", foreign_key: "decidim_project_id"
end
Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ en:
paper_ballots: Paper ballots
imports:
help:
paper_ballot_results: "The import document should contain the following columns: id (with the project's id) and paper_ballots_to_import (with the number of new votes for the project that should be imported). You can simply reuse an export of all the projects and add a column named 'paper_ballots_to_import'."
paper_ballot_results: "The import document should contain the following columns: 'id' (with the project's id) and 'paper_ballots_to_import' (with the number of new votes for the project that should be imported). You can simply reuse an export of all the projects and add a column named 'paper_ballots_to_import'."
label:
paper_ballot_results: Import paper ballots
resources:
Expand Down
8 changes: 7 additions & 1 deletion lib/decidim/budgets_paper_ballots/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
require "decidim/core"
require "decidim/budgets"
require "decidim/budgets_paper_ballots/import"
require "decidim/budgets_paper_ballots/project_serializer"
require "decidim/budgets_paper_ballots/project_serializer_override"

module Decidim
module BudgetsPaperBallots
Expand Down Expand Up @@ -32,6 +32,12 @@ class Engine < ::Rails::Engine
end
end
end

initializer "budgets_paper_ballots.register_resources" do
Decidim.register_resource(:paper_ballot_result) do |resource|
resource.model_class_name = "Decidim::BudgetsPaperBallots::PaperBallotResult"
end
end
end
end
end

0 comments on commit 3e5d279

Please sign in to comment.