Skip to content
Browse files

Merge pull request #5304 from kennyj/fix_connection_dependency

Revert table_name= needs connection now, so just stub table_name
  • Loading branch information...
2 parents f0ad853 + f2b0485 commit f3a3203b00438c7c2782ad6a914a73f96dec95f7 @tenderlove tenderlove committed Mar 6, 2012
View
2 activerecord/lib/active_record/model_schema.rb
@@ -118,7 +118,7 @@ def table_name=(value)
if defined?(@table_name)
return if value == @table_name
- reset_column_information
+ reset_column_information if connected?
end
@table_name = value
View
2 railties/test/generators/session_migration_generator_test.rb
@@ -15,7 +15,7 @@ def test_session_migration_with_given_name
end
def test_session_migration_with_custom_table_name
- ActiveRecord::SessionStore::Session.stubs(:table_name => "custom_table_name")
+ ActiveRecord::SessionStore::Session.table_name = "custom_table_name"
run_generator
assert_migration "db/migrate/add_sessions_table.rb" do |migration|
assert_match(/class AddSessionsTable < ActiveRecord::Migration/, migration)

0 comments on commit f3a3203

Please sign in to comment.
Something went wrong with that request. Please try again.