Class: Motor::ApiConfigsController
- Inherits:
-
ApiBaseController
- Object
- ActionController::API
- ApiBaseController
- Motor::ApiConfigsController
- Defined in:
- app/controllers/motor/api_configs_controller.rb
Instance Method Summary collapse
Methods included from CurrentAbility
Methods included from CurrentUserMethod
Instance Method Details
#create ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/motor/api_configs_controller.rb', line 14 def create @api_config.save! Motor::Configs::WriteToFile.call render json: { data: Motor::ApiQuery::BuildJson.call(@api_config, params, current_ability) } rescue ActiveRecord::RecordNotUnique find_or_initialize_api_config retry end |
#destroy ⇒ Object
26 27 28 29 30 31 32 |
# File 'app/controllers/motor/api_configs_controller.rb', line 26 def destroy @api_config&.update!(deleted_at: Time.current) Motor::Configs::WriteToFile.call head :ok end |