Rails 2.0 missing find_or_create_by_name and find_or_initialize_by_name


just found out that Rails 2.0 (in the prerelease version) does not
have the extended dynamic finders
find_or_create_by_name and find_or_initialize_by_name

They are mentioned in the old 1.x docs http://api.rubyonrails.org/classes/ActiveRecord/Base.html
(section "Dynamic attribute-based finders")

But I couldnt find it in the edge docs (http://caboo.se/doc.html)

Could somebody hint me at what to do? Did they move to a plugin?
which? Are there lines I can implement myself?

Any help appreciated,



They're still there. Check out method_missing on ActiveRecord::Base. :slight_smile:


Thx Russel.
But how come that it does not work. I get this error printed below.
What can I do to make it work with the current pre-release?


Sorry. found out that my model PoliceJournal did not have "name" I
should have used

Sorry to have interrupted you.