Oh lord, I had forgotten that parent_id was in my own extensions to the table and in looking at the schema.rb file forgot that the id value is implicit in all tables. Need more coffee...
I had added parent_id explicitly to support subcategories. Sorry for the confusion. I'll be better soon. :-) BTW, can I suggest adding support for subcategories to the base code? Dan On Thu, Mar 21, 2013 at 12:12 PM, Bruno Bornsztein < bruno.bornszt...@gmail.com> wrote: > Uh.. again, I'm not sure why your categories table has a parent_id on, or > why it doesn't have an id column. It seems like something's amiss with your > migrations. I get the sense that your CE install is not quite right. Here's > what your schema should look like with a default install: > > https://gist.github.com/bborn/5214271 > > > On Thu, Mar 21, 2013 at 11:06 AM, Dan Coutu <co...@snowy-owl.com> wrote: > >> Okay so now we have two mysteries: >> >> 1. What is the purpose of the parent_id in the categories table? >> 2. Why is it that the tables violate the active record convention of >> having an id value on all tables? >> >> I would offer that not having an id value on all table is a serious >> mistake. I had just assumed that the tables had an id value and in fact had >> created migrations intended to create an association between categories and >> a table of my own that I added. But without an id value on the categories >> table that won't work well. I guess I'll be adding it. I do think that for >> the CE code to be world-class reusable and flexible it should be revised to >> include id values on all tables. >> >> Dan >> >> >> On Thursday, March 21, 2013 8:52:48 AM UTC-4, Bruno wrote: >> >>> Hi Dan, >>> There's no category_id on the categories table, or at least there >>> shouldn't be. Not sure why yours has one. Can you check your migrations? >>> >>> >>> On Wed, Mar 20, 2013 at 10:22 PM, Dan Coutu <co...@snowy-owl.com> wrote: >>> >>>> I see that the schema for categories has a parent_id that is clearly >>>> intended to provide an ability to support subcategories to an arbitrary >>>> depth. However the model doesn't seem reflect this with a belongs_to. >>>> >>>> Am I misunderstanding the purpose of the parent_id field? >>>> >>>> Dan >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "CommunityEngine" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to communityengi...@**googlegroups.com. >>>> To post to this group, send email to communi...@googlegroups.**com. >>>> >>>> Visit this group at http://groups.google.com/** >>>> group/communityengine?hl=en<http://groups.google.com/group/communityengine?hl=en> >>>> . >>>> For more options, visit >>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out> >>>> . >>>> >>>> >>>> >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "CommunityEngine" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to communityengine+unsubscr...@googlegroups.com. >> >> To post to this group, send email to communityengine@googlegroups.com. >> Visit this group at http://groups.google.com/group/communityengine?hl=en. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- > You received this message because you are subscribed to a topic in the > Google Groups "CommunityEngine" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/communityengine/q81FHFScDNQ/unsubscribe?hl=en > . > To unsubscribe from this group and all its topics, send an email to > communityengine+unsubscr...@googlegroups.com. > To post to this group, send email to communityengine@googlegroups.com. > Visit this group at http://groups.google.com/group/communityengine?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "CommunityEngine" group. To unsubscribe from this group and stop receiving emails from it, send an email to communityengine+unsubscr...@googlegroups.com. To post to this group, send email to communityengine@googlegroups.com. Visit this group at http://groups.google.com/group/communityengine?hl=en. For more options, visit https://groups.google.com/groups/opt_out.