Skip to content

Commit

Permalink
Fix Sam Ruby's tests and deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlhuda committed Mar 4, 2010
1 parent 1776969 commit 9795bf0
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion railties/guides/source/configuring.textile
Expand Up @@ -159,7 +159,7 @@ WARNING: Threadsafe operation in incompatible with the normal workings of develo

* +config.action_controller.relative_url_root+ can be used to tell Rails that you are deploying to a subdirectory. The default is +ENV['RAILS_RELATIVE_URL_ROOT']+.

* +config.action_controller.session_store+ sets the name of the store for session data. The default is +:cookie_store+; other valid options include +:active_record_store+, +:mem_cache_store+ or the name of your own custom class.
* +config.action_dispatch.session_store+ sets the name of the store for session data. The default is +:cookie_store+; other valid options include +:active_record_store+, +:mem_cache_store+ or the name of your own custom class.

The caching code adds two additional settings:

Expand Down
2 changes: 1 addition & 1 deletion railties/guides/source/security.textile
Expand Up @@ -92,7 +92,7 @@ Rails 2 introduced a new default session storage, CookieStore. CookieStore saves
That means the security of this storage depends on this secret (and on the digest algorithm, which defaults to SHA512, which has not been compromised, yet). So _(highlight)don't use a trivial secret, i.e. a word from a dictionary, or one which is shorter than 30 characters_. Put the secret in your environment.rb:

<ruby>
config.action_controller.session = {
config.action_dispatch.session = {
:key => '_app_session',
:secret => '0x0dkfj3927dkc7djdh36rkckdfzsg...'
}
Expand Down
Expand Up @@ -4,12 +4,12 @@
# If you change this key, all old sessions will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
ActionController::Base.session = {
Rails.application.config.action_dispatch.session = {
:key => '_<%= app_name %>_session',
:secret => '<%= app_secret %>'
}

# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rake db:sessions:create")
# ActionController::Base.session_store = :active_record_store
# Rails.application.config.action_dispatch.session_store = :active_record_store
4 changes: 2 additions & 2 deletions railties/test/application/configuration_test.rb
Expand Up @@ -177,7 +177,7 @@ def teardown
require "action_controller/railtie"

class MyApp < Rails::Application
config.action_controller.session = { :key => "_myapp_session", :secret => "3b7cd727ee24e8444053437c36cc66c4" }
config.action_dispatch.session = { :key => "_myapp_session", :secret => "3b7cd727ee24e8444053437c36cc66c4" }
end

MyApp.initialize!
Expand All @@ -204,7 +204,7 @@ def index
require "action_controller/railtie"

class MyApp < Rails::Application
config.action_controller.session = { :key => "_myapp_session", :secret => "3b7cd727ee24e8444053437c36cc66c4" }
config.action_dispatch.session = { :key => "_myapp_session", :secret => "3b7cd727ee24e8444053437c36cc66c4" }
config.action_dispatch.x_sendfile_header = 'X-Lighttpd-Send-File'
end

Expand Down
4 changes: 2 additions & 2 deletions railties/test/application/initializers/frameworks_test.rb
Expand Up @@ -65,15 +65,15 @@ def setup
test "database middleware doesn't initialize when session store is not active_record" do
add_to_config <<-RUBY
config.root = "#{app_path}"
config.action_controller.session_store = :cookie_store
config.action_dispatch.session_store = :cookie_store
RUBY
require "#{app_path}/config/environment"

assert !Rails.application.config.middleware.include?(ActiveRecord::SessionStore)
end

test "database middleware initializes when session store is active record" do
add_to_config "config.action_controller.session_store = :active_record_store"
add_to_config "config.action_dispatch.session_store = :active_record_store"

require "#{app_path}/config/environment"

Expand Down
Expand Up @@ -10,7 +10,7 @@ def setup

Object.const_set(:MyApplication, Class.new(Rails::Application))
MyApplication.class_eval do
config.action_controller.session = { :key => "_myapp_session", :secret => "OMG A SEKRET" * 10 }
config.action_dispatch.session = { :key => "_myapp_session", :secret => "OMG A SEKRET" * 10 }
end
end

Expand Down
4 changes: 2 additions & 2 deletions railties/test/application/paths_test.rb
Expand Up @@ -11,8 +11,8 @@ def setup
app_file "config/environments/development.rb", ""
add_to_config <<-RUBY
config.root = "#{app_path}"
config.after_initialize do
ActionController::Base.session_store = nil
config.after_initialize do |app|
app.config.action_dispatch.session_store = nil
end
RUBY
use_frameworks [:action_controller, :action_view, :action_mailer, :active_record]
Expand Down
2 changes: 1 addition & 1 deletion railties/test/application/url_generation_test.rb
Expand Up @@ -14,7 +14,7 @@ def app
require "action_controller/railtie"

class MyApp < Rails::Application
config.action_controller.session = { :key => "_myapp_session", :secret => "3b7cd727ee24e8444053437c36cc66c4" }
config.action_dispatch.session = { :key => "_myapp_session", :secret => "3b7cd727ee24e8444053437c36cc66c4" }
end

MyApp.initialize!
Expand Down
2 changes: 1 addition & 1 deletion railties/test/isolation/abstract_unit.rb
Expand Up @@ -100,7 +100,7 @@ def build_app(options = {})
end
end

add_to_config 'config.action_controller.session = { :key => "_myapp_session", :secret => "bac838a849c1d5c4de2e6a50af826079" }'
add_to_config 'config.action_dispatch.session = { :key => "_myapp_session", :secret => "bac838a849c1d5c4de2e6a50af826079" }'
end

class Bukkit
Expand Down

0 comments on commit 9795bf0

Please sign in to comment.