Class: SoftValidationsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- SoftValidationsController
- Defined in:
- app/controllers/soft_validations_controller.rb
Constant Summary
Constants included from ProjectsHelper
ProjectsHelper::CLASSIFIER, ProjectsHelper::CLASSIFIER_ANNOTATION
Instance Method Summary collapse
-
#fix ⇒ Object
POST /soft_validations/fix?global_id=<>.
- #get_object ⇒ Object protected
- #soft_validate_params ⇒ Object protected
-
#validate ⇒ Object
GET /soft_validations/validate.
Methods included from DataControllerConfiguration::ProjectDataControllerConfiguration
Methods included from RedirectHelper
Methods included from RequestType
Methods included from LogRecent
Methods included from Cookies
#digest_cookie, #digested_cookie_exists?
Methods included from Whitelist
Methods included from ProjectsHelper
#cumulative_gb_per_year, #document_cumulative_gb_per_year, #document_gb_per_year, #gb_per_year, #image_cumulative_gb_per_year, #image_gb_per_year, #invalid_object, #project_classification, #project_link, #project_matches, #project_tag, #projects_list, #projects_search_form, #taxonworks_classification, #week_in_review_graphs
Methods included from Api::Intercept
Methods included from TokenAuthentication
#intercept_project, #intercept_user, #intercept_user_or_project, #project_token_authenticate, #token_authenticate
Instance Method Details
#fix ⇒ Object
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, include_flagged: true) ## Use 'include_flagged: false' on all automatic fixes @object.fix_soft_validations render :validate end |
#get_object ⇒ Object (protected)
20 21 22 23 24 |
# File 'app/controllers/soft_validations_controller.rb', line 20 def get_object uri = URI::RFC2396_Parser.new.unescape(params[:global_id] || '') @object = GlobalID::Locator.locate(uri) raise ActiveRecord::RecordNotFound if @object.nil? end |
#soft_validate_params ⇒ Object (protected)
26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/soft_validations_controller.rb', line 26 def soft_validate_params params.permit( only_sets: [], only_methods: [], except_methods: [], except_sets: [], include_flagged: [], ).to_h.symbolize_keys end |
#validate ⇒ Object
GET /soft_validations/validate
7 8 9 |
# File 'app/controllers/soft_validations_controller.rb', line 7 def validate @object.soft_validate(**soft_validate_params, include_flagged: true) end |