]> git.openstreetmap.org Git - rails.git/blob - vendor/plugins/sql_session_store/README
Internationalise the trace controller. Fixes #1894.
[rails.git] / vendor / plugins / sql_session_store / README
1 == SqlSessionStore
2
3 See http://railsexpress.de/blog/articles/2005/12/19/roll-your-own-sql-session-store
4
5 Only Mysql, Postgres and Oracle are currently supported (others work,
6 but you won't see much performance improvement).
7
8 == Step 1
9
10 If you have generated your sessions table using rake db:sessions:create, go to Step 2
11
12 If you're using an old version of sql_session_store, run
13     script/generate sql_session_store DB
14 where DB is mysql, postgresql or oracle
15
16 Then run
17     rake migrate
18 or
19     rake db:migrate
20 for edge rails.
21
22 == Step 2
23
24 Add the code below after the initializer config section:
25
26     ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.
27       update(:database_manager => SqlSessionStore)
28
29 Finally, depending on your database type, add
30
31     SqlSessionStore.session_class = MysqlSession
32 or
33
34     SqlSessionStore.session_class = PostgresqlSession
35 or
36     SqlSessionStore.session_class = OracleSession
37
38 after the initializer section in environment.rb
39
40 == Step 3 (optional)
41
42 If you want to use a database separate from your default one to store
43 your sessions, specify a configuration in your database.yml file (say
44 sessions), and establish the connection on SqlSession in
45 environment.rb:
46
47    SqlSession.establish_connection :sessions
48
49
50 == IMPORTANT NOTES
51
52 1. The class name SQLSessionStore has changed to SqlSessionStore to
53    let Rails work its autoload magic.
54
55 2. You will need the binary drivers for Mysql or Postgresql.
56    These have been verified to work:
57
58    * ruby-postgres (0.7.1.2005.12.21) with postgreql 8.1
59    * ruby-mysql 2.7.1 with Mysql 4.1
60    * ruby-mysql 2.7.2 with Mysql 5.0