Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix a wrong return value from reset_sequence_name method. #5832

Merged
merged 1 commit into from

2 participants

@kennyj
Collaborator

This PR fixes a wrong return value from reset_sequence_name method.

Please see @ebeigarts's comment on #5267.

@jonleighton jonleighton merged commit 012bab8 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 13, 2012
  1. @kennyj
This page is out of date. Refresh to see the latest.
View
2  activerecord/lib/active_record/model_schema.rb
@@ -172,8 +172,8 @@ def sequence_name
end
def reset_sequence_name #:nodoc:
- @sequence_name = connection.default_sequence_name(table_name, primary_key)
@explicit_sequence_name = false
+ @sequence_name = connection.default_sequence_name(table_name, primary_key)
end
# Sets the name of the sequence to use when generating ids to the given
View
8 activerecord/test/cases/base_test.rb
@@ -1503,7 +1503,11 @@ def test_clear_cash_when_setting_table_name
after_seq = Joke.sequence_name
assert_not_equal before_columns, after_columns
- assert_not_equal before_seq, after_seq unless before_seq.blank? && after_seq.blank?
+ unless before_seq.nil? && after_seq.nil?
+ assert_not_equal before_seq, after_seq
+ assert_equal "cold_jokes_id_seq", before_seq
+ assert_equal "funny_jokes_id_seq", after_seq
+ end
end
def test_dont_clear_sequence_name_when_setting_explicitly
@@ -1514,7 +1518,7 @@ def test_dont_clear_sequence_name_when_setting_explicitly
Joke.table_name = "funny_jokes"
after_seq = Joke.sequence_name
- assert_equal before_seq, after_seq unless before_seq.blank? && after_seq.blank?
+ assert_equal before_seq, after_seq unless before_seq.nil? && after_seq.nil?
end
def test_dont_clear_inheritnce_column_when_setting_explicitly
Something went wrong with that request. Please try again.