I''m working on a hosted type app whereby most models are in the scope of an "account". Categories belong to accounts, posts belong to categories, comments belong to posts. However I also made posts and comments belong to accounts as well, for two reasons - - being able to get orphaned posts for an account (ones where the parent category was deleted, and the foreign key is NULL) - easy way to get posts for an account outside the scope of categories: @account.posts.find(:all, :order => "num_views DESC") The problem I am having is with the build method and creating new rows. This code will not keep the newly created post in scope with the account (only the category): @account.categories.find(1).posts.build nor will this of course: @category = @account.categories.find(1) @category.posts.build I''ve tried to avoid setting the account_id or category_id manually in every part of the app, but is this my only option in this case? Or is there a more elegant way of doing this in order to ensure consistency? Thanks for any help :) --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---