mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 19:20:37 +02:00
Story#118912395 - rearrange before_action for more readability
This commit is contained in:
parent
866f44815d
commit
a51f536781
1 changed files with 7 additions and 5 deletions
|
@ -6,8 +6,14 @@ class EppController < ApplicationController
|
||||||
|
|
||||||
before_action :generate_svtrid
|
before_action :generate_svtrid
|
||||||
before_action :latin_only
|
before_action :latin_only
|
||||||
|
|
||||||
before_action :validate_against_schema
|
before_action :validate_against_schema
|
||||||
|
before_action :validate_request
|
||||||
|
before_action :update_epp_session
|
||||||
|
|
||||||
|
around_action :catch_epp_errors
|
||||||
|
|
||||||
|
helper_method :current_user
|
||||||
|
|
||||||
def validate_against_schema
|
def validate_against_schema
|
||||||
return if ['hello', 'error', 'keyrelay'].include?(params[:action])
|
return if ['hello', 'error', 'keyrelay'].include?(params[:action])
|
||||||
schema.validate(params[:nokogiri_frame]).each do |error|
|
schema.validate(params[:nokogiri_frame]).each do |error|
|
||||||
|
@ -20,10 +26,7 @@ class EppController < ApplicationController
|
||||||
handle_errors and return if epp_errors.any?
|
handle_errors and return if epp_errors.any?
|
||||||
end
|
end
|
||||||
|
|
||||||
before_action :validate_request
|
|
||||||
before_action :update_epp_session
|
|
||||||
|
|
||||||
around_action :catch_epp_errors
|
|
||||||
def catch_epp_errors
|
def catch_epp_errors
|
||||||
err = catch(:epp_error) do
|
err = catch(:epp_error) do
|
||||||
yield
|
yield
|
||||||
|
@ -34,7 +37,6 @@ class EppController < ApplicationController
|
||||||
handle_errors
|
handle_errors
|
||||||
end
|
end
|
||||||
|
|
||||||
helper_method :current_user
|
|
||||||
|
|
||||||
rescue_from StandardError do |e|
|
rescue_from StandardError do |e|
|
||||||
@errors ||= []
|
@errors ||= []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue