Katello/katello — pull request #2590 by iNecas (2013-07-04 13:02:56+00:00)
Title: 981311 - fix nested constraints with match routes

Due to bug in Rails, this code:

scope :module => :v2, :constraints => ApiVersionConstraint.new(:version =>
2) do
match '/systems' => 'systems#activate', :via => :post, :constraints =>
RegisterWithActivationKeyContraint.new
end

causes the version 2 of systems#activate to be used, even the version 2 is no
specified in headers (the nested constraints are not combined when using with
match.

This code works as expected:

scope :module => :v2, :constraints => ApiVersionConstraint.new(:version =>
2) do
scope :constraints => RegisterWithActivationKeyContraint.new do
match '/systems' => 'systems#activate', :via => :post
end
end