Allow ActiveRecordStore.session_class to be evaluated lazily
Prevents Active Record from being loaded early in an initializer (where the session_class is being set. This can slow down application boot time.
Hum, how does this work with reloading? Isn't the solution to set it in to_prepare?
Right, I think we would still need to use to_prepare, but we don't want to load Active Record on application boot. Using a proc or a string would allow this, along with the setter clearing the instance ivar should cover both of our concerns. For apps that don't care about the load penalty, they can still use a plain old to_prepare with the base class.
but we don't want to load Active Record on application boot.
Then:
ActiveSupport.on_load(:active_record) do
config.to_prepare do
# ....
end
end
Or am I missing something?