thesteady/supportme — pull request #12 by novohispano (2013-06-19 01:07:38+00:00)
Title: Customers / View Refactoring / Model Relationships

## Changes in this Pull Request

Refactoring Home and Layouts views to improve code readibility on views. Defined User, Customer, Chat model relationships. Added tests to customer controller and model. Coverage is 100 per cent.

### Customer

* Added Customer model.
* Added Customers controller.
* Added Customer new and create routes.
* Added Customer new view which will help to render the iFrame in the widget tab that will be installed on other people's sites.

### Layout View

* Moved Navbar into partial.
* Moved Flash notices into partial.

### Home View

* Moved modal into partial.
* Moved login form into partial.
* Included the background picture in home to improve load speed.

### Migrations

* Added relationships between models: customer_id added to Chat.

### Model Relationships

* Customer has_many chats.
* Customer has_many messages through chats.
* User has_many chats.
* User has_many messages through chats.
* Chats belongs_to user and to customer.

### Todo

* Link user to chats.
* Keep working on the code that the user will need to generate to view the widget.