Skip to content

Commit

Permalink
Use params value only if present
Browse files Browse the repository at this point in the history
  • Loading branch information
pacodelaluna committed Dec 26, 2024
1 parent 16506c4 commit f75cf3d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/controllers/admin/enterprises_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ def edit
@object.build_custom_tab if @object.custom_tab.nil?
return unless params[:stimulus]

@enterprise.is_primary_producer = params[:is_primary_producer]
@enterprise.sells = params[:enterprise_sells]
if params[:is_primary_producer].present?
@enterprise.is_primary_producer = params[:is_primary_producer]
end
@enterprise.sells = params[:enterprise_sells] if params[:enterprise_sells].present?

render cable_ready: cable_car.morph("#side_menu", partial("admin/shared/side_menu"))
.morph("#permalink", partial("admin/enterprises/form/permalink"))
end
Expand Down

0 comments on commit f75cf3d

Please sign in to comment.