Skip to content

Commit eef4ed0

Browse files
author
Anna
committed
.find(:first) deprecated
1 parent 664965e commit eef4ed0

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

test/cases/attribute_methods_test_sqlserver.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class AttributeMethodsTest < ActiveRecord::TestCase
1818
fixtures :developers
1919

2020
def test_coerced_read_attributes_before_type_cast_on_datetime
21-
developer = Developer.find(:first)
21+
developer = Developer.first
2222
if developer.created_at_before_type_cast.is_a?(String)
2323
assert_equal "#{developer.created_at.to_s(:db)}.000" , developer.attributes_before_type_cast["created_at"]
2424
end

test/cases/method_scoping_test_sqlserver.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test_coerced_test_merged_scoped_find
1818
Developer.send(:with_scope, :find => { :conditions => "salary < 100000" }) do
1919
Developer.send(:with_scope, :find => { :offset => 1, :order => 'id asc' }) do
2020
assert_sql /ORDER BY id asc/i do
21-
assert_equal(poor_jamis, Developer.find(:first, :order => 'id asc'))
21+
assert_equal(poor_jamis, Developer.first(:order => 'id asc'))
2222
end
2323
end
2424
end

test/cases/specific_schema_test_sqlserver.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ class SpecificSchemaTestSqlserver < ActiveRecord::TestCase
133133

134134
should 'can find by biginit' do
135135
assert_equal @bi5k, @edge_class.find_by_bigint(@b5k)
136-
assert_equal @b5k, @edge_class.find(:first, :select => 'bigint', :conditions => {:bigint => @b5k}).bigint
136+
assert_equal @b5k, @edge_class.first(:select => 'bigint', :conditions => {:bigint => @b5k}).bigint
137137
assert_equal @bimjr, @edge_class.find_by_bigint(@bnum)
138-
assert_equal @bnum, @edge_class.find(:first, :select => 'bigint', :conditions => {:bigint => @bnum}).bigint
138+
assert_equal @bnum, @edge_class.first(:select => 'bigint', :conditions => {:bigint => @bnum}).bigint
139139
end
140140

141141
end

0 commit comments

Comments
 (0)