Skip to content

Commit 042ffe2

Browse files
author
Anna
committed
.find(:first) deprecated
1 parent 899e5ac commit 042ffe2

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

test/cases/attribute_methods_test_sqlserver.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,35 @@ class AttributeMethodsTestSqlserver < ActiveRecord::TestCase
66
end
77

88
class AttributeMethodsTest < ActiveRecord::TestCase
9-
9+
1010
COERCED_TESTS = [
1111
:test_read_attributes_before_type_cast_on_datetime,
1212
:test_typecast_attribute_from_select_to_false,
1313
:test_typecast_attribute_from_select_to_true
1414
]
15-
15+
1616
include SqlserverCoercedTest
17-
17+
1818
fixtures :developers
19-
19+
2020
def test_coerced_read_attributes_before_type_cast_on_datetime
2121
developer = Developer.find(:first)
2222
if developer.created_at_before_type_cast.is_a?(String)
23-
assert_equal "#{developer.created_at.to_s(:db)}.000" , developer.attributes_before_type_cast["created_at"]
23+
assert_equal "#{developer.created_at.to_s(:db)}.000" , developer.attributes_before_type_cast["created_at"]
2424
end
2525
end
26-
26+
2727
def test_coerced_typecast_attribute_from_select_to_false
2828
topic = Topic.create(:title => 'Budget')
29-
topic = Topic.find(:first, :select => "topics.*, CASE WHEN 1=2 THEN 1 ELSE 0 END as is_test")
29+
topic = Topic.first(select => "topics.*, CASE WHEN 1=2 THEN 1 ELSE 0 END as is_test")
3030
assert !topic.is_test?
3131
end
32-
32+
3333
def test_coerced_typecast_attribute_from_select_to_true
3434
topic = Topic.create(:title => 'Budget')
35-
topic = Topic.find(:first, :select => "topics.*, CASE WHEN 2=2 THEN 1 ELSE 0 END as is_test")
35+
topic = Topic.first(:select => "topics.*, CASE WHEN 2=2 THEN 1 ELSE 0 END as is_test")
3636
assert topic.is_test?
3737
end
38-
39-
38+
39+
4040
end

0 commit comments

Comments
 (0)