Class: Tomify::Api::Admin::UsersController

Inherits:
Object
  • Object
show all
Defined in:
app/controllers/tomify/api/admin/users_controller.rb

Instance Method Summary collapse

Instance Method Details

#not_allowedObject



10
11
12
13
14
15
# File 'app/controllers/tomify/api/admin/users_controller.rb', line 10

def not_allowed
  find_record
  if @record.email == "[email protected]" || @record.id == current_user.id
    render json: { type: :danger, message: "You shall not pass" }
  end
end

#record_paramsObject



4
5
6
7
8
# File 'app/controllers/tomify/api/admin/users_controller.rb', line 4

def record_params
  attributes = super
  attributes[:invited] = true if action_name == "create"
  attributes
end