Skip to content

Commit

Permalink
Backport 'Pass the budget context to the admin new and edit actions f…
Browse files Browse the repository at this point in the history
…or projects' to v0.28 (#12438)

* Pass the budget context to the admin new and edit actions for projects

* Lint

* Lint

Co-authored-by: Antti Hukkanen <antti.hukkanen@mainiotech.fi>
  • Loading branch information
alecslupu and ahukkanen authored Feb 13, 2024
1 parent b00e5bb commit 2ac60e0
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def collection
def new
enforce_permission_to :create, :project
@form = form(ProjectForm).from_params(
attachment: form(AttachmentForm).instance
{ attachment: form(AttachmentForm).instance },
budget:
)
end

Expand All @@ -43,7 +44,7 @@ def create

def edit
enforce_permission_to(:update, :project, project:)
@form = form(ProjectForm).from_model(project)
@form = form(ProjectForm).from_model(project, budget:)
@form.attachment = form(AttachmentForm).instance
end

Expand Down

0 comments on commit 2ac60e0

Please sign in to comment.