Sessions with an s

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2220 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 d25fe84a
*SVN*
* Added create_session_table, drop_session_table, and purge_session_table as rake tasks for databases that supports migrations (MySQL, PostgreSQL, SQLite) to get a table for use with CGI::Session::ActiveRecordStore
* Added create_sessions_table, drop_sessions_table, and purge_sessions_table as rake tasks for databases that supports migrations (MySQL, PostgreSQL, SQLite) to get a table for use with CGI::Session::ActiveRecordStore
* Added dump of schema version to the db_structure_dump task for databases that support migrations #1835 [Rick Olson]
......
......@@ -19,7 +19,7 @@
# config.log_level = Logger::DEBUG
# Use the database for sessions instead of the file system
# (create the session table with 'rake create_session_table')
# (create the session table with 'rake create_sessions_table')
# config.session_options[:database_manager] = CGI::Session::ActiveRecordStore
# See Rails::Configuration for more options
......
......@@ -97,7 +97,7 @@ task :purge_test_database => :environment do
end
desc "Creates a sessions table for use with CGI::Session::ActiveRecordStore"
task :create_session_table => :environment do
task :create_sessions_table => :environment do
raise "Task unavailable to this database (no migration support)" unless ActiveRecord::Base.connection.supports_migrations?
ActiveRecord::Base.connection.create_table :sessions do |t|
......@@ -110,12 +110,12 @@ task :create_session_table => :environment do
end
desc "Drop the sessions table"
task :drop_session_table => :environment do
task :drop_sessions_table => :environment do
raise "Task unavailable to this database (no migration support)" unless ActiveRecord::Base.connection.supports_migrations?
ActiveRecord::Base.connection.drop_table :sessions
end
desc "Drop and recreate the session table (much faster than 'DELETE * FROM sessions')"
task :purge_session_table => [ :drop_session_table, :create_session_table ] do
task :purge_sessions_table => [ :drop_sessions_table, :create_sessions_table ] do
end
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册