tuxedio/tuxedo-proto — pull request #135 by thejinxters (2014-08-09 15:44:20+00:00)
Title: F single user account

Single User account is here! Now instead of having two log-in areas, we have one that vendors and people can both sign into their accounts with.

Breakdown of how this was done:

- Created a user model with a polymorphic association called "rolable" that is hooked into devise
- Modified Vendor and Person models to associate to rolable and removed their devise capabilities.
- Did an override of the routes for user_registration to create a vendor registration and person registration that are seperate (although using the same template with different partials)
- Updated all instances of "vendor_signed_in?" and "person_signed_in?" to check if a user is signed in instead and then checking if the current_user is a vendor or person using new methods defined in the user model.
- Updated individual paths (routes) for models to use the same routes except for the registration.
- Fixed all Rspec and Cucumber tests.. Should be passing 100%
- Updated the populate script to work with new model associations
- Merged posgres change into this branch, had a small issue with accessing the postgres from rails which was solved by adding a "host: localhost" to database.yml

Now vendor/person is accessed via .rolable and User is accessed by .user -- only devise options are stored in user at the moment (email, password), but we can add more shared elements if desired... Right now what we have doesn't make sense to share

Left the individual views for person and vendor devise options in case we want to steal them later for use in the devise view folder.

Small Postgres Notes:
- Needed to install and start postgres
- Needed to add "host: localhost" to database.yml
- Needed to run rake db:create before running db:migrate
- Needed to create database for testing in console with command "createdb tuxedo_test"

Once that was in place, everything seemed to work super smoothly.