Skip to content

Commit

Permalink
Decent Exposure 3: fake migration to strong parameters
Browse files Browse the repository at this point in the history
Fake it until you can make it.
  • Loading branch information
ysbaddaden committed Nov 28, 2023
1 parent b9a10d5 commit ef5385f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/controllers/collections_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def create
end

def update
if collection.update_attributes params[:collection]
if collection.update collection_params
collection.recreate_index
redirect_to collection_settings_path(collection), notice: _("Collection %{collection_name} updated") % { collection_name: collection.name }
else
Expand Down Expand Up @@ -310,4 +310,10 @@ def upload_logo
preview_url: uploader.url(:preview)})
end

private

# TODO: migrate to strong parameters
def collection_params
params[:collection].permit!
end
end

0 comments on commit ef5385f

Please sign in to comment.