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
854
854
And our initializer:
855
855
856
856
` ` ` 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'
859
859
860
860
resque_config = YAML.load_file(rails_root + '/config/resque.yml')
861
861
Resque.redis = resque_config[rails_env]
862
862
```
863
863
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
865
865
this way we can tell our Sinatra app about the config file:
866
866
867
867
$ 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.
872
872
For example, if you want to run all jobs in the same process for cucumber, try:
873
873
874
874
``` ruby
875
- Resque .inline = ENV [ ' RAILS_ENV ' ] == " cucumber"
875
+ Resque .inline = Rails .env. cucumber?
876
876
```
877
877
878
878
You can’t perform that action at this time.
0 commit comments