Yes you could just build your own for this task or that task, but then 
you start adding function after function until you realize why 
activerecord made associations in the first place (getters, setters, 
callbacks, reflections). =)

I tried patching polymorphic associations, its not easy, because you 
have to change the behavior in like 10 different places. Its not pretty.

Im not worried about the time searching for the record, Im frustrated 
about using 30 bytes to store "ThisLongClassNameBlahBlah" vs 1 byte to 
store a number that maps to that name for every record.

Also, I'd have to add a "_type" column even though you could infer the 
classname based off another column, thus making things anything but DRY.


Maurício Linhares wrote:
> You could just build your own associations solution instead of trying to
> patch the polymorphic associations.
> 
> Also, if you have indexes for the columns, the time "searching" for the 
> row
> isn't really different than it would be for a number instead of a 
> varchar.
> The database should hit the result row in the same time.
> 
> On Tue, Oct 7, 2008 at 11:07 PM, Aryk Grosz <
> [EMAIL PROTECTED]> wrote:
> 
>> For example, what if I wanted to have the "type" column be a tinyint
>> to patch this to get it to work properly. Is anyone also having issues
>> with this or is there anything out there to give you more control over
>> polymorphic associations?
>>
>> Aryk Grosz
>> Mixbook.com
>> --
>> Posted via http://www.ruby-forum.com/.
>>
>>
> 
> --
> Maurício Linhares
> http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ 
> (en)
> João Pessoa, PB, +55 83 8867-7208

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