What’s the best way to exclude ActiveRecord in Rails3?
In Rails2, one could just do:
config.frameworks -= [ :active_record ]
in the configuration block in environment.rb. Is it possible in Rails3?
Thanks.
Anuj
What’s the best way to exclude ActiveRecord in Rails3?
In Rails2, one could just do:
config.frameworks -= [ :active_record ]
in the configuration block in environment.rb. Is it possible in Rails3?
Thanks.
Anuj
As far as I know the way to do this is to change this line in config/application.rb:
require “rails/all”
To these lines (this is most of the code from “rails/all”):
require “rails”
%w(
action_controller
action_mailer
active_resource
rails/test_unit
).each do |framework|
begin
require “#{framework}/railtie”
rescue LoadError
end
end
I’ve removed active_record from the above array.
Thanks. I thought there might be a better way to achieve the same.
Anuj
For a new application, you can do:
rails new myapp --skip-active-record
Aha…cool. Thanks.
Anuj
Yup, that basically does what Ryan mentioned, changes rails/all to load individual frameworks (excluding activerecord ofcourse)
Anuj