Class: Services::ValidationController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Services::ValidationController
- 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_object ⇒ Object
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 |