diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-11-29 16:33:50 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-11-29 20:13:37 +0000 |
commit | 7af719e81c46d06f50cd9b3caff38b945c5f2d84 (patch) | |
tree | 48186ea74bb6186d18b245598f0188a40a3ef901 /activerecord/test | |
parent | fd7ca98bb6218de42b821d48db083ea8c0e97d67 (diff) | |
download | rails-7af719e81c46d06f50cd9b3caff38b945c5f2d84.tar.gz rails-7af719e81c46d06f50cd9b3caff38b945c5f2d84.tar.bz2 rails-7af719e81c46d06f50cd9b3caff38b945c5f2d84.zip |
Deprecate set_sequence_name in favour of self.sequence_name=
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 8 | ||||
-rw-r--r-- | activerecord/test/models/company.rb | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 9fc9197aa5..3a84e40f57 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1515,7 +1515,9 @@ class BasicsTest < ActiveRecord::TestCase k.sequence_name = "foo" assert_equal "foo", k.sequence_name - k.set_sequence_name "bar" + assert_deprecated do + k.set_sequence_name "bar" + end assert_equal "bar", k.sequence_name end @@ -1525,7 +1527,9 @@ class BasicsTest < ActiveRecord::TestCase orig_name = k.sequence_name if orig_name - k.set_sequence_name { original_sequence_name + "_lol" } + assert_deprecated do + k.set_sequence_name { original_sequence_name + "_lol" } + end assert_equal orig_name + "_lol", k.sequence_name else skip "sequences not supported by db" diff --git a/activerecord/test/models/company.rb b/activerecord/test/models/company.rb index 78eb4c57ac..fe9c465c81 100644 --- a/activerecord/test/models/company.rb +++ b/activerecord/test/models/company.rb @@ -4,7 +4,7 @@ end class Company < AbstractCompany attr_protected :rating - set_sequence_name :companies_nonstd_seq + self.sequence_name = :companies_nonstd_seq validates_presence_of :name |