Class: SoftValidationsController

Inherits:
ApplicationController show all
Includes:
DataControllerConfiguration::ProjectDataControllerConfiguration
Defined in:
app/controllers/soft_validations_controller.rb

Instance Method Summary collapse

Methods included from DataControllerConfiguration::ProjectDataControllerConfiguration

#annotator_params

Methods included from RedirectHelper

#destroy_redirect

Methods included from RequestType

#json_request?

Methods included from LogRecent

#log_user_recent_route

Methods included from Cookies

#digest_cookie, #digested_cookie_exists?

Methods included from Whitelist

#whitelist_constantize

Methods included from ProjectsHelper

#invalid_object, #project_link, #project_matches, #project_tag, #projects_list, #projects_search_form

Methods included from Api::Intercept

#intercept_api

Methods included from TokenAuthentication

#intercept_project, #intercept_user, #intercept_user_or_project, #project_token_authenticate, #token_authenticate

Instance Method Details

#fixObject

POST /soft_validations/fix?global_id=<>



12
13
14
15
16
# File 'app/controllers/soft_validations_controller.rb', line 12

def fix
  @object.soft_validate(soft_validate_params)
  @object.fix_soft_validations
  render :validate
end

#get_objectObject (protected)

Raises:

  • (ActiveRecord::RecordNotFound)


20
21
22
23
24
# File 'app/controllers/soft_validations_controller.rb', line 20

def get_object
  uri = URI.decode(params[:global_id] || '')
  @object = GlobalID::Locator.locate(uri)
  raise ActiveRecord::RecordNotFound if @object.nil?
end

#soft_validate_paramsObject (protected)



26
27
28
29
30
31
32
33
# File 'app/controllers/soft_validations_controller.rb', line 26

def soft_validate_params
  params.permit(
    only_sets: [],
    only_methods: [],
    except_methods: [],
    except_sets: [],
  ).to_h.symbolize_keys
end

#validateObject

GET /soft_validations/validate



7
8
9
# File 'app/controllers/soft_validations_controller.rb', line 7

def validate
  @object.soft_validate(soft_validate_params)
end