Class: Services::ValidationController

Inherits:
ApplicationController show all
Defined in:
app/controllers/services/validation_controller.rb

Constant Summary

Constants inherited from ApplicationController

ApplicationController::MAX_LIST_LENGTH

Instance Method Summary collapse

Instance Method Details

#valid_objectObject



7
8
9
10
11
12
13
# File 'app/controllers/services/validation_controller.rb', line 7

def valid_object
  object_type = params[:object_type]
  object_id = params[:object_id]

  exists = eval(object_type).where("id = ?", object_id).count > 0
  render json: { exists: exists }
end