File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -854,14 +854,14 @@ So that you can flush it and without impacting development environment
854854And our initializer:
855855
856856` ` ` ruby
857- rails_root = ENV['RAILS_ROOT'] || File.dirname(__FILE__) + '/../..'
858- rails_env = ENV['RAILS_ENV'] || 'development'
857+ rails_root = Rails.root || File.dirname(__FILE__) + '/../..'
858+ rails_env = Rails.env || 'development'
859859
860860resque_config = YAML.load_file(rails_root + '/config/resque.yml')
861861Resque.redis = resque_config[rails_env]
862862```
863863
864- Easy peasy! Why not just use ` RAILS_ROOT ` and ` RAILS_ENV ` ? Because
864+ Easy peasy! Why not just use ` Rails.root ` and ` Rails.env ` ? Because
865865this way we can tell our Sinatra app about the config file:
866866
867867 $ RAILS_ENV=production resque-web rails_root/config/initializers/resque.rb
@@ -872,7 +872,7 @@ Also, you could disable jobs queueing by setting 'inline' attribute.
872872For example, if you want to run all jobs in the same process for cucumber, try:
873873
874874``` ruby
875- Resque .inline = ENV [ ' RAILS_ENV ' ] == " cucumber"
875+ Resque .inline = Rails .env. cucumber?
876876```
877877
878878
You can’t perform that action at this time.
0 commit comments