On Tue, Dec 29, 2009 at 8:32 AM, Marnen Laibow-Koser <[email protected]> wrote:
>> That didn't work but got me thinking in a workable direction, thanks. > > Why didn't it work? That should be foolproof, unless I screwed up the > syntax. >> User.max(:id) + 10 NoMethodError: undefined method `max' for #<Class:0x101e8f060> > Data integrity checking isn't business logic in the usual sense -- and > it really is the job of the database. I'll disagree. In this case, requiring a valid user to be associated with an object *is* a business decision; tomorrow, I could decide to allow anonymous object creation, or anonymous creation in some specific circumstances only. Committing a code fix to that effect is a lot better to my thinking than requiring everyone involved to make the comparable changes in all their DB instances (if it's even possible to handle that logic in the DB). YMMV, -- Hassan Schroeder ------------------------ [email protected] twitter: @hassan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" 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-talk?hl=en.

