Hassan Schroeder wrote:
> 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>

OK, syntax goof.  Sorry.

> 
>> 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.

Then you can change your schema at that point.  Till then, YAGNI.

> 
> 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).

WTF?  Don't you use migrations?  That's what they're for.

Anyway, crippling your current app because of a future situation that 
may not ever occur is extremely bad practice.  Develop for what you have 
*now*.

Sorry, Hassan.  Normally I respect your posts here very much, but in 
this case I think you're coming up with increasingly tenuous 
justifications for a very bad design decision.

> 
> 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.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
Posted via http://www.ruby-forum.com/.

--

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.


Reply via email to