Forums » General Forum »
require 'lockdown' in environment.rb
Added by Marc Lee 162 days ago
Hi. I'm using JRuby to include some jar files in my environment and having a bit of a situation where lockdown is trying to load the controller classes which had includes to jars that have not yet be created (they were going to be build in the later tasks) during a rake db:migrate invocation. As a result we moved the require 'lockdown' statement to the ApplicationController instead. Do you see any problems that might surface from that?
Thanks for all the work you have done on it. It's great!
Replies
RE: require 'lockdown' in environment.rb - Added by Andrew Stone 162 days ago
Hey Marc,
Having the require "lockdown/init" in the application.rb will slow you down in development mode, but should be fine in production mode. The only reason the require statement is in envrionment.rb is to restrict the inspection of the controllers to a one-time occurrence. I'm not sure if there are negative side effects to having the require "lockdown/init" called multiple times, I would have to revisit the code to be sure.
I haven't used JRuby so I'm not familiar with the process required. If you need to and if it will work, you could create a config/initializer/lockdown.rb and put the require statement there, but that may not help you.?
Thanks for using Lockdown,
andy