Use Active Record session store
This commit is contained in:
parent
cec8a18d42
commit
18b254e3d1
@ -1,8 +1,8 @@
|
|||||||
# Be sure to restart your server when you modify this file.
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
Scube::Application.config.session_store :cookie_store, :key => '_scube_session'
|
#Scube::Application.config.session_store :cookie_store, :key => '_scube_session'
|
||||||
|
|
||||||
# Use the database for sessions instead of the cookie-based default,
|
# Use the database for sessions instead of the cookie-based default,
|
||||||
# which shouldn't be used to store highly confidential information
|
# which shouldn't be used to store highly confidential information
|
||||||
# (create the session table with "rails generate session_migration")
|
# (create the session table with "rails generate session_migration")
|
||||||
# Scube::Application.config.session_store :active_record_store
|
Scube::Application.config.session_store :active_record_store
|
||||||
|
16
db/migrate/20110804225816_add_sessions_table.rb
Normal file
16
db/migrate/20110804225816_add_sessions_table.rb
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
class AddSessionsTable < ActiveRecord::Migration
|
||||||
|
def self.up
|
||||||
|
create_table :sessions do |t|
|
||||||
|
t.string :session_id, :null => false
|
||||||
|
t.text :data
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
|
||||||
|
add_index :sessions, :session_id
|
||||||
|
add_index :sessions, :updated_at
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.down
|
||||||
|
drop_table :sessions
|
||||||
|
end
|
||||||
|
end
|
12
db/schema.rb
12
db/schema.rb
@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# It's strongly recommended to check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(:version => 20110726101228) do
|
ActiveRecord::Schema.define(:version => 20110804225816) do
|
||||||
|
|
||||||
create_table "playlists", :force => true do |t|
|
create_table "playlists", :force => true do |t|
|
||||||
t.string "name"
|
t.string "name"
|
||||||
@ -18,6 +18,16 @@ ActiveRecord::Schema.define(:version => 20110726101228) do
|
|||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
create_table "sessions", :force => true do |t|
|
||||||
|
t.string "session_id", :null => false
|
||||||
|
t.text "data"
|
||||||
|
t.datetime "created_at"
|
||||||
|
t.datetime "updated_at"
|
||||||
|
end
|
||||||
|
|
||||||
|
add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
|
||||||
|
add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"
|
||||||
|
|
||||||
create_table "tracks", :force => true do |t|
|
create_table "tracks", :force => true do |t|
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user