Skip to content

Commit

Permalink
Merge pull request #119 from isqad/master
Browse files Browse the repository at this point in the history
feature: optional constraint for resque job_status
  • Loading branch information
ashalaev authored Oct 23, 2017
2 parents 799b244 + deec7c2 commit a02b231
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
end
end

get '/_job_(/:id)', to: 'resque/jobs#show', as: 'job_status', constraints: {domain: :current}
get '/_job_(/:id)',
to: 'resque/jobs#show',
as: 'job_status',
constraints: ::Rails.application.config.resque_job_status.fetch(:route_constraints)
end
4 changes: 4 additions & 0 deletions lib/resque/integration/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,9 @@ class Engine < Rails::Engine
initializer "resque-integration.extensions" do
::Resque::Worker.send :include, ::Resque::Integration::Extensions::Worker
end

initializer 'resque-integration.application', before: :load_config_initializers do |app|
app.config.resque_job_status = {route_constraints: {domain: :current}}
end
end # class Engine
end # module Resque::Integration
2 changes: 1 addition & 1 deletion lib/resque/integration/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Resque
module Integration
VERSION = '1.16.3'.freeze
VERSION = '1.16.4'.freeze
end
end

0 comments on commit a02b231

Please sign in to comment.