Skip to content

Commit 0ffe190

Browse files
committed
Extract ActiveRecord::SessionStore from Rails
This functionality will be available from gem `active_record-session_store` instead.
1 parent 2c571b3 commit 0ffe190

File tree

18 files changed

+10
-947
lines changed

18 files changed

+10
-947
lines changed

actionpack/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## Rails 4.0.0 (unreleased) ##
22

3+
* `ActiveRecord::SessionStore` is extracted out of Rails into a gem `activerecord-session_store`.
4+
Setting `config.session_store` to `:active_record_store` will no longer work and will break
5+
if the `activerecord-session_store` gem isn't available. *Prem Sichanugrist*
6+
37
* Fix select_tag when option_tags is nil.
48
Fixes #7404.
59

actionpack/lib/action_controller/base.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,6 @@ module ActionController
8888
#
8989
# Do not put secret information in cookie-based sessions!
9090
#
91-
# Other options for session storage:
92-
#
93-
# * ActiveRecord::SessionStore - Sessions are stored in your database, which works better than PStore with multiple app servers and,
94-
# unlike CookieStore, hides your session contents from the user. To use ActiveRecord::SessionStore, set
95-
#
96-
# MyApplication::Application.config.session_store :active_record_store
97-
#
98-
# in your <tt>config/initializers/session_store.rb</tt> and run <tt>script/rails g session_migration</tt>.
99-
#
10091
# == Responses
10192
#
10293
# Each action results in a response, which holds the headers and document to be sent to the user's browser. The actual response

actionpack/test/activerecord/active_record_store_test.rb

Lines changed: 0 additions & 288 deletions
This file was deleted.

activerecord/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## Rails 4.0.0 (unreleased) ##
22

3+
* ActiveRecord::SessionStore has been extracted from Active Record as `activerecord-session_store`
4+
gem. Please read the `README.md` file on the gem for the usage. *Prem Sichanugrist*
5+
36
* Fix `reset_counters` when there are multiple `belongs_to` association with the
47
same foreign key and one of them have a counter cache.
58
Fixes #5200.

activerecord/lib/active_record.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,6 @@ module ActiveRecord
5353
autoload :ReadonlyAttributes
5454
autoload :Reflection
5555
autoload :Sanitization
56-
57-
# ActiveRecord::SessionStore depends on the abstract store in Action Pack.
58-
# Eager loading this class would break client code that eager loads Active
59-
# Record standalone.
60-
#
61-
# Note that the Rails application generator creates an initializer specific
62-
# for setting the session store. Thus, albeit in theory this autoload would
63-
# not be thread-safe, in practice it is because if the application uses this
64-
# session store its autoload happens at boot time.
65-
autoload :SessionStore
66-
6756
autoload :Schema
6857
autoload :SchemaDumper
6958
autoload :SchemaMigration

activerecord/lib/active_record/railties/databases.rake

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -408,21 +408,6 @@ db_namespace = namespace :db do
408408
end
409409
end
410410
end
411-
412-
namespace :sessions do
413-
# desc "Creates a sessions migration for use with ActiveRecord::SessionStore"
414-
task :create => [:environment, :load_config] do
415-
raise 'Task unavailable to this database (no migration support)' unless ActiveRecord::Base.connection.supports_migrations?
416-
Rails.application.load_generators
417-
require 'rails/generators/rails/session_migration/session_migration_generator'
418-
Rails::Generators::SessionMigrationGenerator.start [ ENV['MIGRATION'] || 'add_sessions_table' ]
419-
end
420-
421-
# desc "Clear the sessions table"
422-
task :clear => [:environment, :load_config] do
423-
ActiveRecord::Base.connection.execute "DELETE FROM #{ActiveRecord::SessionStore::Session.table_name}"
424-
end
425-
end
426411
end
427412

428413
namespace :railties do

0 commit comments

Comments
 (0)