Thanks for the input,
I wouldnt say this is exactly a complicated example. Its basically where
you could infer the polymorphic class from STI type sort of thing. Im
pretty sure many other people run into it.
The bottom line is that there is no customizablility.
The problem is that the code has sql strings generated with
"#{variable}_type = X which makes it very hard to replace with a
function to control the outputted polymorphic sql condition.
I wonder if there is anybody else that has run into the same problems.
Maurício Linhares wrote:
> Well, that's definitely a "complicated" example :)
>
> I guess you should try to figure out with the core rails guys where
> you could hack the code to do just that (what would be infer the name
> of the real association from something else), i haven't looked at the
> code myself, but it shouldn't be that hard with the right guidance.
>
> Also, if you want to roll your own solution, it isn't that hard and
> there's also plenty of work already written about the matter, one of
> the best options is Martin Fowler's "Patterns of Enterprise
> Application Architeture" (
> http://martinfowler.com/eaaCatalog/index.html ), there are 3 sections
> about object-relational mapping tool structure.
>
> On Wed, Oct 8, 2008 at 1:30 AM, Aryk Grosz
> <[EMAIL PROTECTED]> wrote:
>>
>> So, now I need a "detail_type" column of "BookDetail" or in other words
>> "#{product_type.classify}Detail".
>>
>> Now I have two extra string columns that are not needed and are making
>> things much less DRY.
>>
>> Aryk
>
>
>
> --
> 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
-~----------~----~----~----~------~----~------~--~---