array = [] array << { username: 'username', password: 'password' }
User.new(user_params)
def user_params allowed_params = [].tap do |array| array << :first_name array << :last_name array << :admin if current_user.admin? end params.require(:user).permit(allowed_params) end