diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-12-27 14:46:38 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-12-27 14:46:38 +0530 |
commit | 85770ec7139fcba985310d239d4c57cfe6f6c60b (patch) | |
tree | 6ac06f74e46385f86ef51feb55e69730f1ca1020 /activerecord/test | |
parent | d511de0261003aae4913e3c24f76df6e03a35916 (diff) | |
download | rails-85770ec7139fcba985310d239d4c57cfe6f6c60b.tar.gz rails-85770ec7139fcba985310d239d4c57cfe6f6c60b.tar.bz2 rails-85770ec7139fcba985310d239d4c57cfe6f6c60b.zip |
Make Model.find_or_create_by_* and find_or_initialize_by_* use relations and remove method caching
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/finder_test.rb | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/activerecord/test/cases/finder_test.rb b/activerecord/test/cases/finder_test.rb index 59c016d19c..c531a2dec1 100644 --- a/activerecord/test/cases/finder_test.rb +++ b/activerecord/test/cases/finder_test.rb @@ -880,13 +880,6 @@ class FinderTest < ActiveRecord::TestCase assert !c.new_record? end - def test_dynamic_find_or_initialize_from_one_attribute_caches_method - class << Company; self; end.send(:remove_method, :find_or_initialize_by_name) if Company.public_methods.any? { |m| m.to_s == 'find_or_initialize_by_name' } - assert !Company.public_methods.any? { |m| m.to_s == 'find_or_initialize_by_name' } - sig38 = Company.find_or_initialize_by_name("38signals") - assert Company.public_methods.any? { |m| m.to_s == 'find_or_initialize_by_name' } - end - def test_find_or_initialize_from_two_attributes another = Topic.find_or_initialize_by_title_and_author_name("Another topic","John") assert_equal "Another topic", another.title |