Commit b52015d912639f1c44d8d5f7fd4176dd3ceabfb0

Authored by Rodrigo Souto
2 parents f59157a6 bc0150d2

Merge commit 'refs/merge-requests/376' of git://gitorious.org/noosfero/noosfero …

…into merge-requests/376

Conflicts:
	db/schema.rb
config/environment.rb
... ... @@ -48,7 +48,7 @@ Rails::Initializer.run do |config|
48 48  
49 49 # Use the database for sessions instead of the file system
50 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 53 # Use SQL instead of Active Record's schema dumper when creating the test database.
54 54 # This is necessary if your schema can't be completely dumped by the schema dumper,
... ...
db/migrate/20130918183842_create_sessions.rb 0 → 100644
... ... @@ -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 2 # please use the migrations feature of Active Record to incrementally modify your database, and
3 3 # then regenerate this schema definition.
4 4 #
... ... @@ -520,6 +520,16 @@ ActiveRecord::Schema.define(:version =&gt; 20131011164400) do
520 520 t.integer "context_id"
521 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 533 create_table "taggings", :force => true do |t|
524 534 t.integer "tag_id"
525 535 t.integer "taggable_id"
... ...
vendor/plugins/noosfero_caching/init.rb
... ... @@ -62,7 +62,6 @@ end
62 62  
63 63 unless Rails.env.development?
64 64 middleware = ActionController::Dispatcher.middleware
65   - cookies_mw = ActionController::Session::CookieStore
66 65 ActionController::Base.send(:include, NoosferoHttpCaching)
67   - middleware.insert_before(cookies_mw, NoosferoHttpCaching::Middleware)
  66 + middleware.use NoosferoHttpCaching::Middleware
68 67 end
... ...