I have the following class within config/routes.rb
. When I deploy the application via Elastic Beanstalk with an .ebextensions
file including a post-deploy script to start delayed_job
I receive:
...
warning: already initialized constant DistributionSlugConstraint::MATCH_REGEX
warning: previous definition of MATCH_REGEX was here
delayed_job: running [pid 14867]
...
Class within config/routes.rb
.
class DistributionSlugConstraint
MATCH_REGEX = /B[a-zA-Z1-9_]{5}/
def self.matches?(request)
request.fullpath =~ MATCH_REGEX
end
end
Rails.application.routes.draw do
constraints(DistributionSlugConstraint) do
get "/:slug" => "distributions#show", as: :distribution
end
end