Skip to content

Commit

Permalink
Rename BaseAssetsController#handle_empty_access_limited_param
Browse files Browse the repository at this point in the history
As suggested by @floehopper.
  • Loading branch information
chrisroos committed Mar 7, 2018
1 parent c54dd64 commit ee64cb6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/assets_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def restrict_request_format

def asset_params
normalize_redirect_url(
handle_empty_access_limited_param(params)
normalize_access_limited(params)
.require(:asset)
.permit(:file, :draft, :redirect_url, :replacement_id, :parent_document_url, access_limited: [])
)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/base_assets_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def normalize_redirect_url(params)
params.reject { |k, v| (k.to_sym == :redirect_url) && v.blank? }
end

def handle_empty_access_limited_param(params)
def normalize_access_limited(params)
if params.has_key?(:asset) && params[:asset].has_key?(:access_limited) && params[:asset][:access_limited].empty?
params[:asset][:access_limited] = []
end
Expand Down

0 comments on commit ee64cb6

Please sign in to comment.