Enable a plugin only in production

I’ve started using xsendfile for speeding up delivery of files that
Rails needs to send. The only thing is, I can only use it in
production where Apache and the appropriate module exist.

What would be a good way for selectively enabling the plugin so that
it only runs in production?

Thanks,
Helzer

helzer wrote:

I’ve started using xsendfile for speeding up delivery of files that
Rails needs to send. The only thing is, I can only use it in
production where Apache and the appropriate module exist.

What would be a good way for selectively enabling the plugin so that
it only runs in production?

In init.rb, wrap the exising contents in a test to make sure you’re in
production:

if ENV[‘RAILS_ENV’] == ‘production’

current init.rb contents

end


Josh S.
http://blog.hasmanythrough.com