search for: subtype_type

Displaying 1 result from an estimated 1 matches for "subtype_type".

2007 Aug 02
2
STI functionality, but then with multiple tables
...osts of type link I could do Link.find and I would have only links. But that one behaves so much different from working from Post as in this case I would read the attributes like @link.url, @link.description, @link.post.title Not very consistent, at all. So I use Post.find :all, :conditions => {:subtype_type (bad naming, I know) => ''Link'' To ease that I made a custom find method to accept Post.find :all, :type => :link and all was happy. Sorry for the long post, it''s been on my mind for such a long time already. Anyways... I was very proud on how I got it to work. Onl...