Reputation: 4258
The Rails Guide says, "Fixtures can also transform themselves into the form of the original class. Thus, you can get at the methods only available to that class," and gives the example,
# using the find method, we grab the "real" david as a User
david = users(:david).find
My fixtures are working ok, but when I try
memb = members(:one).find
I get an error: NoMethodError: undefined method `find'. What am I doing wrong?
(Rails Guide reference: http://edgeguides.rubyonrails.org/testing.html#the-low-down-on-fixtures)
Upvotes: 4
Views: 597
Reputation: 3285
The guide is fixed now, and find is not necessary anymore because now users(:david)
is the ActiveRecord object.
Upvotes: 2