I'm still having a hard time looking for the semantics of "find!" (I mean -
what's the dangerous operation being performed?)
There's a few examples in Rails core for this exact sort of behaviour:
ActiveRecord::Base.create vs. ActiveRecord::Base.create!
If create fails it returns an unsaved record. If create! fails you end up with a raised exception.
Base.create! calls Base.save! which, again, raises an exception instead of returning false on failure.
To me the bang on a method that is to perform the same actions as the non-bang method would mean "if this fails, you MUST handle it" instead of the non-bang method which fails silently with only a nil/false return value.
I also second the idea of a some sort of api split between loads and finds but it certainly needs refinement. I think an api change like this early on is better than a confusing or overloaded api that eventually drives people away from the framework.
--
Martin Emde
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/rubyonrails-core
-~----------~----~----~----~------~----~------~--~---
