Arie Kusuma Atmaja
2006-Aug-04 09:00 UTC
[Rails] How to make prefix_sessions recognizable?
Hello, i must use prefix to each of my tables for my project right now. Now i''m facing this session stored in table problem. i don''t use rake db:sessions:create, but i use script/generate migration create_myproject_sessions then create_table :myproject_sessions do |t| t.column :myproject_session_id, :string t.column :data, :text t.column updated_at, :datetime end then run rake db:migrate then play with it, this is the log/development.log Mysql::Error: Table ''mydatabase.sessions'' doesn''t exist: SHOW FIELDS FROM sessions /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connection_adapters/abstract_adapter.rb:120:in `log'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connection_adapters/mysql_adapter.rb:184:in `execute'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connection_adapters/mysql_adapter.rb:292:in `columns'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/base.rb:696:in `columns'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/base.rb:704:in `columns_hash'' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/session/active_record_store.rb:103:in `setup_sessid_compatibility!'' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/session/active_record_store.rb:77:in `find_by_session_id'' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/session/active_record_store.rb:281:in `initialize'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/base.rb:794:in `silence'' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/session/active_record_store.rb:281:in `initialize'' /opt/local/lib/ruby/1.8/cgi/session.rb:273:in `initialize'' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/cgi_process.rb:111:in `session'' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/cgi_process.rb:141:in `stale_session_check!'' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/cgi_process.rb:107:in `session'' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/base.rb:887:in `assign_shortcuts_without_flash'' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/flash.rb:141:in `assign_shortcuts'' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/base.rb:375:in `process_without_filters'' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/filters.rb:377:in `process_without_session_management_support'' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/session_management.rb:117:in `process'' /opt/local/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/dispatcher.rb:38:in `dispatch'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel/rails.rb:73:in `process'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:551:in `process_client'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:550:in `process_client'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:636:in `run'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:636:in `run'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:625:in `run'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:956:in `run'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:955:in `run'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/bin/mongrel_rails:127:in `run'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel/command.rb:199:in `run'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/bin/mongrel_rails:235 /opt/local/bin/mongrel_rails:18 how can i modify it to recognize my prefix_sessions table ? please please help me. Thank you very much for your help before. -- Arie Kusuma Atmaja A.K.A Arie A.K.A ariekeren / YM! = riyari3 http://ariekusumaatmaja.wordpress.com Let''s build Ruby Indonesia stronger http://groups.yahoo.com/groups/id-ruby # Indonesia Ruby Society Dibutuhkan programmer ruby wanita aduhai cantik nan jelita lembut gemulai hati fisik penuh kehangatan dan semua semuanya deh buat menjadi pendamping setia sehidup semati ariekeren. hubungi via Yahoo Messenger di riyari3@yahoo.com Note! Hanya buat yang serius! Lebih diutamakan : Asli Paris dan punya jiwa dan hati -+ kek Arwen