Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Revert table_name= needs connection now, so just stub table_name #5304

Merged
merged 1 commit into from

2 participants

@kennyj
Collaborator

This PR is revert c8f6025.

My commit (2fdb521) broke build, because table_name= method need a connection.

Please see c8f6025

cc @jonleighton @drogus

@tenderlove tenderlove merged commit f3a3203 into rails:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
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)
Something went wrong with that request. Please try again.