Commit bc0150d225107ee6cf0fac4a28d02b39640a8220
1 parent
3aa7898c
Exists in
master
and in
23 other branches
Make session data delete possible with active_record_store
Conflicts: db/schema.rb
Showing
4 changed files
with
30 additions
and
5 deletions
Show diff stats
config/environment.rb
| @@ -48,7 +48,7 @@ Rails::Initializer.run do |config| | @@ -48,7 +48,7 @@ Rails::Initializer.run do |config| | ||
| 48 | 48 | ||
| 49 | # Use the database for sessions instead of the file system | 49 | # Use the database for sessions instead of the file system |
| 50 | # (create the session table with 'rake db:sessions:create') | 50 | # (create the session table with 'rake db:sessions:create') |
| 51 | - # config.action_controller.session_store = :active_record_store | 51 | + config.action_controller.session_store = :active_record_store |
| 52 | 52 | ||
| 53 | # Use SQL instead of Active Record's schema dumper when creating the test database. | 53 | # Use SQL instead of Active Record's schema dumper when creating the test database. |
| 54 | # This is necessary if your schema can't be completely dumped by the schema dumper, | 54 | # This is necessary if your schema can't be completely dumped by the schema dumper, |
| @@ -0,0 +1,16 @@ | @@ -0,0 +1,16 @@ | ||
| 1 | +class CreateSessions < ActiveRecord::Migration | ||
| 2 | + def self.up | ||
| 3 | + create_table :sessions do |t| | ||
| 4 | + t.string :session_id, :null => false | ||
| 5 | + t.text :data | ||
| 6 | + t.timestamps | ||
| 7 | + end | ||
| 8 | + | ||
| 9 | + add_index :sessions, :session_id | ||
| 10 | + add_index :sessions, :updated_at | ||
| 11 | + end | ||
| 12 | + | ||
| 13 | + def self.down | ||
| 14 | + drop_table :sessions | ||
| 15 | + end | ||
| 16 | +end |
db/schema.rb
| 1 | -# This file is auto-generated from the current state of the database. Instead of editing this file, | 1 | +# This file is auto-generated from the current state of the database. Instead of editing this file, |
| 2 | # please use the migrations feature of Active Record to incrementally modify your database, and | 2 | # please use the migrations feature of Active Record to incrementally modify your database, and |
| 3 | # then regenerate this schema definition. | 3 | # then regenerate this schema definition. |
| 4 | # | 4 | # |
| @@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
| 9 | # | 9 | # |
| 10 | # It's strongly recommended to check this file into your version control system. | 10 | # It's strongly recommended to check this file into your version control system. |
| 11 | 11 | ||
| 12 | -ActiveRecord::Schema.define(:version => 20130711213046) do | 12 | +ActiveRecord::Schema.define(:version => 20130918183842) do |
| 13 | 13 | ||
| 14 | create_table "abuse_reports", :force => true do |t| | 14 | create_table "abuse_reports", :force => true do |t| |
| 15 | t.integer "reporter_id" | 15 | t.integer "reporter_id" |
| @@ -520,6 +520,16 @@ ActiveRecord::Schema.define(:version => 20130711213046) do | @@ -520,6 +520,16 @@ ActiveRecord::Schema.define(:version => 20130711213046) do | ||
| 520 | t.integer "context_id" | 520 | t.integer "context_id" |
| 521 | end | 521 | end |
| 522 | 522 | ||
| 523 | + create_table "sessions", :force => true do |t| | ||
| 524 | + t.string "session_id", :null => false | ||
| 525 | + t.text "data" | ||
| 526 | + t.datetime "created_at" | ||
| 527 | + t.datetime "updated_at" | ||
| 528 | + end | ||
| 529 | + | ||
| 530 | + add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id" | ||
| 531 | + add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at" | ||
| 532 | + | ||
| 523 | create_table "taggings", :force => true do |t| | 533 | create_table "taggings", :force => true do |t| |
| 524 | t.integer "tag_id" | 534 | t.integer "tag_id" |
| 525 | t.integer "taggable_id" | 535 | t.integer "taggable_id" |
vendor/plugins/noosfero_caching/init.rb
| @@ -62,7 +62,6 @@ end | @@ -62,7 +62,6 @@ end | ||
| 62 | 62 | ||
| 63 | unless Rails.env.development? | 63 | unless Rails.env.development? |
| 64 | middleware = ActionController::Dispatcher.middleware | 64 | middleware = ActionController::Dispatcher.middleware |
| 65 | - cookies_mw = ActionController::Session::CookieStore | ||
| 66 | ActionController::Base.send(:include, NoosferoHttpCaching) | 65 | ActionController::Base.send(:include, NoosferoHttpCaching) |
| 67 | - middleware.insert_before(cookies_mw, NoosferoHttpCaching::Middleware) | 66 | + middleware.use NoosferoHttpCaching::Middleware |
| 68 | end | 67 | end |