aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/inheritance_test.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2012-04-26 18:32:55 +0100
committerJon Leighton <j@jonathanleighton.com>2012-04-26 18:32:55 +0100
commit75f03eca753f1e835409a80db1f54f716ef48d18 (patch)
tree6ef084ea2ee7b44c574096274ab6d5fa7a308235 /activerecord/test/cases/inheritance_test.rb
parentb30996307d3b8d0d519c7ddcfa28fdeed428b602 (diff)
downloadrails-75f03eca753f1e835409a80db1f54f716ef48d18.tar.gz
rails-75f03eca753f1e835409a80db1f54f716ef48d18.tar.bz2
rails-75f03eca753f1e835409a80db1f54f716ef48d18.zip
remove calls to find(:first), find(:last) and find(:all)
Diffstat (limited to 'activerecord/test/cases/inheritance_test.rb')
-rw-r--r--activerecord/test/cases/inheritance_test.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/test/cases/inheritance_test.rb b/activerecord/test/cases/inheritance_test.rb
index 02df464469..c84448041d 100644
--- a/activerecord/test/cases/inheritance_test.rb
+++ b/activerecord/test/cases/inheritance_test.rb
@@ -15,7 +15,7 @@ class InheritanceTest < ActiveRecord::TestCase
end
def test_class_with_blank_sti_name
- company = Company.find(:first)
+ company = Company.first
company = company.dup
company.extend(Module.new {
def read_attribute(name)
@@ -24,7 +24,7 @@ class InheritanceTest < ActiveRecord::TestCase
end
})
company.save!
- company = Company.find(:all).find { |x| x.id == company.id }
+ company = Company.all.find { |x| x.id == company.id }
assert_equal ' ', company.type
end
@@ -149,7 +149,7 @@ class InheritanceTest < ActiveRecord::TestCase
def test_update_all_within_inheritance
Client.update_all "name = 'I am a client'"
- assert_equal "I am a client", Client.find(:all).first.name
+ assert_equal "I am a client", Client.all.first.name
# Order by added as otherwise Oracle tests were failing because of different order of results
assert_equal "37signals", Firm.find(:all, :order => "id").first.name
end
@@ -259,7 +259,7 @@ class InheritanceComputeTypeTest < ActiveRecord::TestCase
def test_instantiation_doesnt_try_to_require_corresponding_file
ActiveRecord::Base.store_full_sti_class = false
- foo = Firm.find(:first).clone
+ foo = Firm.first.clone
foo.ruby_type = foo.type = 'FirmOnTheFly'
foo.save!