Skip to main content
0 online
deanh77 May 25, 2006

rails is ridiculously easy for this kind of application, sorry I'll try to read mor of this and post some pointers, but wiki.rubyonrails.org is amazing.

iwz May 25, 2006

i've started the work. i've been fixing up me schema a lot, and i've got some of the basic functions of the site up and running locally. in a few days, i'll be ready to check the code into SVN o...

deanh77 May 26, 2006

yeah. that's the most important part. make sure your relationships are good. Also you should look into "Single Table Inheritance" for example class Topic end class ForumThread 'my journa...

iwz May 26, 2006

i definitely gotta do it that way! i do it like that in the current Java code now, to a certain degree. but if i clean up the schema a bit more, this could really shine.

deanh77 deanh77Founder

yeah. I haven't looked at ezabel schema in a while, but I remember you doing something like this. But the difference in Rails is, its part of the ActiveRecord framework. good support for this kind of thing.

iwz iwz

yeah that's really sexy. it figures out the type by the class name?

part of the problem is that I have different tables for everything

news, journals, threads, faqs, events.. all different tables.

i'm pretty sure i could merge news, journals, and threads. but some of the tables have columns specific to the type. i would have to either decide whether or not i really need the extra attributes, or just merge them all in. or have a child table by type or something.

deanh77 deanh77Founder

yeah, that is a slight drawback to STI. it's illustrated here:
http://www.martinfowler.com/eaaCatalog/singleTableInheritance.html

all properties of all classes in the inheritance tree are present in the table as fields.

but its not really a problem, as the unused fields are just left unpopulated.

iwz iwz

yeah that works. sti helps with searching too.

iwz iwz

So, i wrote a migration to create a topics table to merge news, forum_threads, and journals into one table. I combined all the columns. There's only a few that aren't shared, so that's not bad.

Got it working, seems pretty nice.

The only thing I'm wondering now is... do I need separate controllers for each of the models now? So much of the logic is the same, and I want to keep it DRY. Any ideas on sharing some of the logic?

Welcome Back to eZabel

It's been a while. Here's what's new.

eZabel Lore

A complete history of our community — stats, Hall of Fame, legendary threads, and more.

View the Lore →

Everything Preserved

All 225,969 pieces of content from 2000–2014 are here — forums, messages, journals, photos, polls, and events.

💎

Gems

Spot something you love — a legendary comment, a classic thread, a great photo? Log in and click the diamond icon to mark it as a Gem. Add a note about why it's special. The best stuff surfaces on the Gems page.