[Sdruby] checking items in array for same class

Joe Auricchio jauricchio.lists at gmail.com
Tue Aug 29 23:28:11 GMT 2006


Not to put words in Chris's mouth, but it seems to me that he wants  
to ensure the objects in question are all of the same ActiveRecord  
class, which means they'll be written back to the same table and  
represent the same kind of data. That's a legitimate concern for  
business logic: ensuring we're actually working with the data we  
intend to.

Ducktyping is nice, but realistically how often do you add a new kind  
of data, that's completely interchangeable with the old kind, but  
stored in a different table? OO and polymorphism are very nice in  
theory, but where the rubber meets the road sometimes you just want  
to make sure you're only saving the data you're supposed to.

I've wished for something like this for a while but never really got  
around to thinking it through. Thanks Tom!

-joe

On Aug 29, 2006, at 2:51 PM, Michael Genereux wrote:

> Trying but failing?  ;-)
>
> You're on the money on what I meant.  I look forward to Chris'
> impressions of our answers.
>
> On 8/29/06, Jordan A. Fowler <jordan at quicktours.us> wrote:
>> What Michael is trying to say: Instead of just checking the type of
> _______________________________________________
> Sdruby mailing list
> Sdruby at lists.sdruby.com
> http://lists.sdruby.com/mailman/listinfo/sdruby



More information about the Sdruby mailing list