mirror of
https://github.com/iritmaximus/brewery.git
synced 2026-10-12 19:13:49 +03:00
rubocop cleaning
This commit is contained in:
@@ -2,6 +2,7 @@ class ApplicationController < ActionController::Base
|
||||
helper_method :current_user
|
||||
def current_user
|
||||
return nil if session[:user_id].nil?
|
||||
|
||||
User.find session[:user_id]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class UsersController < ApplicationController
|
||||
before_action :set_user, only: %i[ show edit update destroy ]
|
||||
before_action :set_user, only: %i[show edit update destroy]
|
||||
|
||||
# GET /users or /users.json
|
||||
def index
|
||||
@@ -59,13 +59,14 @@ class UsersController < ApplicationController
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_user
|
||||
@user = User.find(params[:id])
|
||||
end
|
||||
|
||||
# Only allow a list of trusted parameters through.
|
||||
def user_params
|
||||
params.require(:user).permit(:username)
|
||||
end
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_user
|
||||
@user = User.find(params[:id])
|
||||
end
|
||||
|
||||
# Only allow a list of trusted parameters through.
|
||||
def user_params
|
||||
params.require(:user).permit(:username)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user