CaryLynch / projectFour

0 stars 0 forks source link

nesting resources & error #6

Closed CaryLynch closed 9 years ago

CaryLynch commented 9 years ago

Hey there Neel.

So, I finished updating all of my models to reflect the list of relationships we established yesterday. Please have a look and tell me if they are all correct. So, once I did that, I finished the seed file- which seems right to me. However, I tried dropping the table, recreating, migrating and seeding with the new seed file and I get this error (not sure what it means):

rake aborted! ActiveRecord::SubclassNotFound: Invalid single-table inheritance type: Wildlife is not a subclass of Cause /Users/macbook1/dev/wdi/projectFour/allGoodDeeds/db/seeds.rb:27:in `<top (required)>' Tasks: TOP => db:seed

So, I talked with a few people and it seems like I may need to namespace since I am trying to nest both causes and deeds inside of users and also nesting organizations inside of causes and deeds (that's a lot of nesting, bro! ;). I came to this route conclusion which is why it seems that I'd need to do all that nesting. Routes: users/id (main user page showing the list of causes they support, and list of deeds they have committed to doing, as well as a button to add a new cause and to add a new deed) users/id/causes/new (form page where the user can select new causes to support and add them to their profile. Redirects to the users/id page) users/id/deeds/new (form page where the user can select new deeds to commit to and add them to their profile. Redirects to the users/id page) users/id/causes/id/organizations (the page you get when you click on a cause listed on the users profile page. What displays on this page is the organizations that are tied to that particular cause id.) users/id/deeds/id/organizations (the page you get when you click on a deed listed on the users profile page. What displays on this page is the organizations that are tied to all of the causes that user supports.) \ ^^ not totally sure about this route since I need it to list out all of the organizations tied to all of the causes that user supports **

SO! I think I'd just like your input on how to best organize all these database calls and if the models relationships are correct . Daniel is namespacing his with an api... just not sure how to do the namespacing.

Thanks Neel! ps- shoot me your GA email so I can send you that Ischia list! :)

CaryLynch commented 9 years ago

Neel- just wanted to let you know I resolved the issue with the error and was able to seed my database properly. I believe everything is set up properly in terms of the database, models and relationships, but would still like your opinion to be sure. Also, still wondering about the routes and namespacing. Please let me know what you think- especially about the routes and if that is how I should have it set up. Thanks.

CaryLynch commented 9 years ago

this is a snapshot of my current routes: project4routes