Skip to content

Commit

Permalink
Extract ActiveRecord::SessionStore from Rails
Browse files Browse the repository at this point in the history
This functionality will be available from gem
`active_record-session_store` instead.
  • Loading branch information
sikachu committed Aug 24, 2012
1 parent 2c571b3 commit 0ffe190
Show file tree
Hide file tree
Showing 18 changed files with 10 additions and 947 deletions.
4 changes: 4 additions & 0 deletions actionpack/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Rails 4.0.0 (unreleased) ##

* `ActiveRecord::SessionStore` is extracted out of Rails into a gem `activerecord-session_store`.
Setting `config.session_store` to `:active_record_store` will no longer work and will break
if the `activerecord-session_store` gem isn't available. *Prem Sichanugrist*

* Fix select_tag when option_tags is nil.
Fixes #7404.

Expand Down
9 changes: 0 additions & 9 deletions actionpack/lib/action_controller/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,6 @@ module ActionController
#
# Do not put secret information in cookie-based sessions!
#
# Other options for session storage:
#
# * ActiveRecord::SessionStore - Sessions are stored in your database, which works better than PStore with multiple app servers and,
# unlike CookieStore, hides your session contents from the user. To use ActiveRecord::SessionStore, set
#
# MyApplication::Application.config.session_store :active_record_store
#
# in your <tt>config/initializers/session_store.rb</tt> and run <tt>script/rails g session_migration</tt>.
#
# == Responses
#
# Each action results in a response, which holds the headers and document to be sent to the user's browser. The actual response
Expand Down
288 changes: 0 additions & 288 deletions actionpack/test/activerecord/active_record_store_test.rb

This file was deleted.

3 changes: 3 additions & 0 deletions activerecord/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Rails 4.0.0 (unreleased) ##

* ActiveRecord::SessionStore has been extracted from Active Record as `activerecord-session_store`
gem. Please read the `README.md` file on the gem for the usage. *Prem Sichanugrist*

* Fix `reset_counters` when there are multiple `belongs_to` association with the
same foreign key and one of them have a counter cache.
Fixes #5200.
Expand Down
11 changes: 0 additions & 11 deletions activerecord/lib/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,6 @@ module ActiveRecord
autoload :ReadonlyAttributes
autoload :Reflection
autoload :Sanitization

# ActiveRecord::SessionStore depends on the abstract store in Action Pack.
# Eager loading this class would break client code that eager loads Active
# Record standalone.
#
# Note that the Rails application generator creates an initializer specific
# for setting the session store. Thus, albeit in theory this autoload would
# not be thread-safe, in practice it is because if the application uses this
# session store its autoload happens at boot time.
autoload :SessionStore

autoload :Schema
autoload :SchemaDumper
autoload :SchemaMigration
Expand Down
15 changes: 0 additions & 15 deletions activerecord/lib/active_record/railties/databases.rake
Original file line number Diff line number Diff line change
Expand Up @@ -408,21 +408,6 @@ db_namespace = namespace :db do
end
end
end

namespace :sessions do
# desc "Creates a sessions migration for use with ActiveRecord::SessionStore"
task :create => [:environment, :load_config] do
raise 'Task unavailable to this database (no migration support)' unless ActiveRecord::Base.connection.supports_migrations?
Rails.application.load_generators
require 'rails/generators/rails/session_migration/session_migration_generator'
Rails::Generators::SessionMigrationGenerator.start [ ENV['MIGRATION'] || 'add_sessions_table' ]
end

# desc "Clear the sessions table"
task :clear => [:environment, :load_config] do
ActiveRecord::Base.connection.execute "DELETE FROM #{ActiveRecord::SessionStore::Session.table_name}"
end
end
end

namespace :railties do
Expand Down
Loading

0 comments on commit 0ffe190

Please sign in to comment.