Skip to content

Commit

Permalink
patch issue with empty repo/standards in research_outputs_controller
Browse files Browse the repository at this point in the history
  • Loading branch information
briri committed May 30, 2023
1 parent 7a9303a commit 6f9a7ec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/controllers/research_outputs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ def create
args = process_nillable_values(args: args)
# Create custom repositories and metadata standards if applicable
args[:repositories_attributes] = create_custom_repositories(
existing: args[:repositories_attributes], custom: custom_repo_params
existing: args.fetch(:repositories_attributes, []), custom: custom_repo_params
)
args[:metadata_standards_attributes] = create_custom_standards(
existing: args[:metadata_standards_attributes], custom: custom_standard_params
existing: args.fetch(:metadata_standards_attributes, []), custom: custom_standard_params
)
@research_output = ResearchOutput.new(args)
authorize @research_output
Expand Down Expand Up @@ -70,10 +70,10 @@ def update

# Create custom repositories and metadata standards if applicable
args[:repositories_attributes] = create_custom_repositories(
existing: args[:repositories_attributes], custom: custom_repo_params
existing: args.fetch(:repositories_attributes, []), custom: custom_repo_params
)
args[:metadata_standards_attributes] = create_custom_standards(
existing: args[:metadata_standards_attributes], custom: custom_standard_params
existing: args.fetch(:metadata_standards_attributes, []), custom: custom_standard_params
)
if @research_output.update(args)
redirect_to plan_research_outputs_path(@plan),
Expand Down

0 comments on commit 6f9a7ec

Please sign in to comment.