Stephen Bannasch
2007-Jun-08 05:40 UTC
problem with rake db:sessions:clear and session_table_name
The comments in: actionpack/lib/action_controller/session/activerecord_store.rb document this method for changing the session table_name: # You may configure the table name, primary key, and data column. # For example, at the end of config/environment.rb: # CGI::Session::ActiveRecordStore::Session.table_name = ''legacy_session_table'' # CGI::Session::ActiveRecordStore::Session.primary_key = ''session_id'' # CGI::Session::ActiveRecordStore::Session.data_column_name = ''legacy_session_data'' I am using this method to set a custom table name in the database for my sessions table. This works fine however there''s a problem with the following rake tasks: rake db:sessions:clear rake db:sessions:create in file: railties/lib/tasks/databases.rb They instead use the state of ActiveRecord::Base.pluralize_table_names to set the table mane to either ''session'' or ''sessions''. I started working on a patch but got confused figuring out where table_name is defined in activerecord_store.rb. It''s defined once as a cattr in this Class: CGI::Session::ActiveRecordStore::SqlBypass.table_name and again somehow in this class: CGI::Session::ActiveRecordStore::Session.table_name Any suggestions on how the patch should be constructed? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Reasonably Related Threads
- Switching to active_record_store session management errors out
- Replacing ActiveRecordStore::Session with a custom model
- ActiveRecordStore: cleanup & avoiding duplication
- Problem with 0.13.1 ActiveRecordStore with PG 8.0.3.
- Exception Notification plugin options hash handling????? backwards merge?