Routes fix

This commit is contained in:
Martin Lensment 2015-01-16 13:40:05 +02:00
parent db77334711
commit ea51bb50b2
3 changed files with 6 additions and 7 deletions

View file

@ -30,8 +30,6 @@ module Registry
config.paths.add File.join('app', 'api'), glob: File.join('**', '*.rb')
config.autoload_paths += Dir[Rails.root.join('app', 'api', '*')]
config.autoload_paths << Rails.root.join('lib')
# Active Record used to suppresses errors raised within
# `after_rollback`/`after_commit` callbacks and only printed them to the logs.
# In the next version, these errors will no longer be suppressed.

View file

@ -11,9 +11,11 @@ class EppConstraint
def matches?(request)
element = "//#{@type}:#{request.params[:action]}"
parsed_frame = Nokogiri::XML(request.params[:raw_frame])
ret = parsed_frame.xpath("#{element}", OBJECT_TYPES[@type]).any?
request.params[:parsed_frame] = parsed_frame.remove_namespaces! if ret
ret
return false if parsed_frame.xpath("#{element}", OBJECT_TYPES[@type]).none?
request.params[:parsed_frame] = parsed_frame.remove_namespaces!
request.params[:epp_object_type] = @type
true
end
end