Polymorphic assosciations - still the way in Rails 2.0.x

I store a lot of information concerning blogs, events, books, bla
bla…

So I have a lot of database tables including the same fields: url,
user_id, subject, comment…

So I decided to use polymorphic assosciations.

Is this still the prefered way in 2.0.x or does Rails 2.0.x offers me
a easier, faster and more preferable way to do this?

By the way, isn’t it much easier to do all the search stuff with only
one table? Perhaps it would not be so fast, but easier?!

Thanx

I dont think that Rails 2.0 has any new ways to do this.

What did you mean by the searching?


Ryan B.

Feel free to add me to MSN and/or GTalk as this email.

What did you mean by the searching?

Let’s say a visitor wants to search the whole webseite for
“activerecord”. Then I have to query all tables (blogs, books,
forums) … and the showing the results. When all these things are
stored in only ONE table things a much easier to handle.

On 2 Jan., 05:46, “Ryan B.” [email protected] wrote:

Storing them all into one table sounds complicated, but I understand what
you’re trying to achieve.

:slight_smile:

I don’t think that it’s possible to put all that information into the one
table without over complicating things.
Have you heard of acts_as_ferret? That’s pretty good for searing.

Yes, I heard of it but never used it. I will give it a try.

Thanx

Storing them all into one table sounds complicated, but I understand
what
you’re trying to achieve.

I don’t think that it’s possible to put all that information into the
one
table without over complicating things.

Have you heard of acts_as_ferret? That’s pretty good for searing.

On Jan 2, 2008 2:59 PM, Jochen K. [email protected] wrote:


Ryan B.

Feel free to add me to MSN and/or GTalk as this email.

On Jan 1, 8:18 pm, Jochen K. [email protected] wrote:

I store a lot of information concerning blogs, events, books, bla
bla…

So I have a lot of database tables including the same fields: url,
user_id, subject, comment…

Three letters: D, R, and Y. :slight_smile:

I would definitely factor that data out into its own model. Your
searches will be faster, since you’ll be querying one table instead of
X many tables.

///ark