I think we still need to support older release of Rails and only use that for 2.3 and above.
In the code
Quote:
ActiveRecord::Base.clear_active_connections! if defined?(ActiveRecord::Base)
may not work well unless the function has been added back in, seems it is missing in latest rails 2.2 release.
That's why we need to update RailsRunner.rb to discount and reconnect the connection manually in the latest version.
is coming back into ActiveRecord::Base in rails 2.3, so it should be fine.
I have to make the RailsRunner.rb compatible with Rails 1.x 2.2 and 2.3 by combining the current RailsRunner.rb and the one you put up on github.
Is there any easy way to detect the Rails version being used at the beginning?
I am thinking adding ruby code to extract the version number from file "RAILS_ROOT/config/environment.rb, at the beginning of the file,
"RAILS_GEM_VERSION" is set to the version of Rails should be used.
I am thinking adding ruby code to extract the version number from file "RAILS_ROOT/config/environment.rb, at the beginning of the file,
"RAILS_GEM_VERSION" is set to the version of Rails should be used.
Can anyone help with the ruby code?
If I can help I will - what exactly are you after? Some additions to the github code above? e.g. do you just want to do something like
if RAILS_GEM_VERSION >= 2.3.2
# use rack
else
# use old system
end
or did you want to get the RAILS_GEM_VERSION number out to litespeed?
I am not sure we can do "require config/environment" at the beginning of the file or not. The code for 2.3 does not have that.
I am thinking about some ruby code to open config/environment.rb and search for RAILS_GEM_VERSION .