human_power icon indicating copy to clipboard operation
human_power copied to clipboard

Rails Environment-specific Configuration

Open marktran opened this issue 11 years ago • 4 comments

Is there any way to have different configurations for different Rails environments?

if Rails.env.production?
  disallow :none
else
  disallow :all
end

Error:

NoMethodError (undefined method `env' for HumanPower::Rails:Module):
  config/robots.rb:1:in `block in robots'
  lib/silverpop_middleware.rb:13:in `call'
  lib/health_check_middleware.rb:10:in `call'

marktran avatar Jan 23 '14 21:01 marktran

Yes, try ::Rails instead of Rails.

I'll look into this.

Thanks.

lassebunk avatar Jan 23 '14 21:01 lassebunk

I guess it's not a bug Since you are supposed to use :: if you want top level constant

PikachuEXE avatar Feb 11 '14 03:02 PikachuEXE

@lassebunk Close or fix?_?

PikachuEXE avatar Feb 17 '14 01:02 PikachuEXE

This will be fixed. It's unintentional, so it's kind of a bug. :blush:

lassebunk avatar Feb 18 '14 11:02 lassebunk