So here we are again…another assessment blog post for the Web Development Track. I hope you enjoyed the last one on my WeWorkRemotely Ruby CLI Gem. This time, I’ll be talking about the Sinatra Project Management System I’ve created using Ruby.

The Assignment Requirements

  1. Build an MVC Sinatra Application.
  2. Use ActiveRecord with Sinatra.
  3. Use Multiple Models.
  4. Use at least one has_many relationship
  5. Must have user accounts. The user that created the content should be the only person who can modify that content
  6. Models must have validations to ensure that bad data isn’t created
  7. Any validation failures must be shown to user with an error message

My Project Idea & Initial Hangup

After reviewing the project requirements and viewing the examples of previous assignments, I decided to create a pretty simple project management system that would have a database, users, projects, tasksĀ for those projects, and categories for both projects and tasks. This was my original data model idea:

Original Sinatra Project Management System Database Model

Original Database Drawing for my SPMS

Well, after a day of trial and error of attempting to make the Models I was creating match the product I had envisioned, it still wasn’t working. I couldn’t correctly create a join table to do exactly what I wanted. This is when I reached out for help from someone on the Learn-co staff. Much to my delight, Avi came to my rescue and simplified my system even more and helped me with understanding how to use my Tasks table as a join table. This meant I didn’t have to create a separate join table. Yippee!

The revised drawing of the Sinatra Project Management System database tables.

The revised drawing of the SPMS database tables.

See how much easier that is to wrap your head around!? I love it!

Period of Enlightenment & Building

After Avi ushered me into a period of enlightenment, I sat and coded for a few solid hours and got most of the general project working. After having spent a whole day attempting to get my original idea working just on the Model level, this was AWESOME.

Once the major building part was over, it took about 30 minutes to go through and QA the project to be sure everything did as I wanted.