Skip to content

Commit

Permalink
Merge tool-collections into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
stage-branch-merger[bot] authored Jul 19, 2023
2 parents 7effb0f + 435a5ba commit 003d10d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 4 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,8 @@ def initialize(code, message)
errors.add(code, message)
end
end

def convert_hyphen_to_dash
params.deep_transform_keys! { |key| key.tr("-", "_") }
end
end
6 changes: 1 addition & 5 deletions app/controllers/tool_groups_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class ToolGroupsController < ApplicationController
before_action :authorize!
before_action :transform_params, only: [:create, :update]
before_action :convert_hyphen_to_dash, only: [:create, :update]

def index
render json: tool_groups_ordered_by_name, include: params[:include], fields: field_params, status: :ok
Expand Down Expand Up @@ -28,10 +28,6 @@ def update

private

def transform_params
params.deep_transform_keys!{ |key| key.tr('-', '_') }
end

def tool_groups_ordered_by_name
ToolGroup.order(name: :asc)
end
Expand Down

0 comments on commit 003d10d

Please sign in to comment.