rosa-build/app/controllers/users/base_controller.rb

17 lines
346 B
Ruby
Raw Permalink Normal View History

class Users::BaseController < ApplicationController
2015-03-04 23:19:19 +00:00
before_action :authenticate_user!
before_action :find_user
protected
def find_user
if user_id = params[:uname] || params[:user_id] || params[:id]
2012-12-27 18:27:50 +00:00
@user = User.opened.find_by_insensitive_uname! user_id
end
end
2013-03-01 11:33:02 +00:00
def set_current_user
@user = current_user
end
end