rubyonrailsin

A Ruby and Rails talk

Thursday, March 11, 2010


[Rails] Bypassing automatic STI generation

by rubyonrailsin 0 comments

Tag


Share this post:
Design Float
StumbleUpon
Reddit

Hi,

Let's say I have the following:

Product < AR
Memberships < Product

I know that the product with id 10 has its type column set to
"Membership", but still I'd like to treat it as a regular product.

So if I do: Product.find(10), Rails returns a Membership object.

Is it possible to tell rails to not care about STI and to simply return
a Product object?

Regards,
--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment

Subscribe feeds via e-mail

Blog Archive