Skip to content

Commit 74f4cef

Browse files
committed
lint: Fix rubocop offences.
1 parent 919bb56 commit 74f4cef

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

app/controllers/barcodes_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,6 @@ def destroy
8787
private
8888

8989
def barcode_params
90-
params.require(:barcode).permit(:code)
90+
params.expect(barcode: [:code])
9191
end
9292
end

app/controllers/orders_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,6 @@ def overview
177177
private
178178

179179
def order_params
180-
params.require(:order).permit(order_items_attributes: %i[count price product_id])
180+
params.expect(order: [order_items_attributes: %i[count price product_id]])
181181
end
182182
end

app/controllers/products_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def update
7272
private
7373

7474
def product_params
75-
params.require(:product).permit(:name, :price, :avatar, :category, :stock, :calories, :deleted, :barcode,
76-
barcodes_attributes: %i[id code _destroy])
75+
params.expect(product: [:name, :price, :avatar, :category, :stock, :calories, :deleted, :barcode,
76+
{ barcodes_attributes: %i[id code _destroy] }])
7777
end
7878
end

0 commit comments

Comments
 (0)