
rake db:sessions:* fails
Reported by Gibheer | May 20th, 2010 @ 12:16 PM | in 1.0.0
The command
# rake db:sessions:create
and
# rake db:sessions:clean
fail with the message "undefined method configurations'
for Rails::DataMapper:Module". The Problem is in the file
lib/dm-rails/railties/database.rake line 113 and 120.
Comments and changes to this ticket
-
Gibheer May 20th, 2010 @ 12:51 PM
I did a grep on the complete code of dm-rails and there was no Rails::DataMapper.configurations[Rails.env] anywhere, but I found Rails::DataMapper.configuration.repositories[Rails.env]. When I replaced the first with the latter, the rake script worked. Is that the intended behavior?
-
Dan Kubb (dkubb) May 20th, 2010 @ 12:52 PM
- State changed from new to unconfirmed
- Assigned user set to Martin Gamsjaeger (snusnu)
-
Gibheer May 21st, 2010 @ 02:54 PM
There are two more changes, to make the Sessions work.
file: lib/dm-rails/session_store.rb
line 4: module ActionDispatch
line 5: module SessionThese are necessary, that ActionDispatch can find the SessionStore.
So there are two more changes to make:
file: lib/dm-rails/railties/database.rake
line 114: ActionDispatch::Session::SessionStore::Session.auto_migrate!
line 121: ActionDispatch::Session::SessionStore::Session.all.destroy!together with the changes of #2, that should do.
-
Gibheer May 21st, 2010 @ 02:56 PM
Ah, I forget to mention, how to get it working. You have to change the config/initialize/session_store.rb and comment out the third line. Then append the following two lines:
require 'dm-rails/session_store'
Rails.application.config.session_store :session_store -
Dan Kubb (dkubb) May 26th, 2010 @ 02:07 AM
- Milestone set to 1.0.0
-
Dan Kubb (dkubb) June 3rd, 2010 @ 02:22 PM
- State changed from unconfirmed to resolved
(from [2f517413dc966c29e6781bc2132a95ff169871dd]) Adds support for datamapper session stores
Usage:
Replace the content of
- config/initializers/session_store.rb
with the following:
require 'dm-rails/session_store' Rails.application.config.session_store(
Rails::DataMapper::SessionStore
}
[#1278 state:resolved] http://github.com/datamapper/dm-rails/commit/2f517413dc966c29e6781b...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
People watching this ticket
Referenced by
-
1278 rake db:sessions:* fails [#1278 state:resolved] http://github.com/datamapper/dm-r...