← Back to Upcase

Creating a Boy Scout STEM application


(Rod Jenkins) #1

I am in the process of creating a rails application for a group of Boy Scouts. There are some web applications out there that track progress and awards. However, I have not found one that meets my needs. I would like some feedback on some of the directions I am heading in.

I will eventually have 4 user types:
Scouts - The boys that will enter their work on the site, request mentor approval, etc
Mentors - The adults the scout will work with to approve the requirements were met. many to many scouts
Scoutmasters - Adults from the Scouts troops, could be more that one, the could also be mentors, many to many scouts
Admins - sets up the awards and requirements approves what adults can see what scouts, etc.

I think the best way is to use STI on the Users table to create the various user types. The only wrinkle is Mentors, can also be Scoutmasters and/or admins. Would it be better two have only two types of users, Scouts and Adults (with flags)?

One other thing I am not sure how to accomplish is how to handle setting up the awards and the requirements and the scout’s answers. At first I was going to do: Scout has_many Awards, and Awards has_many requirements. However, there is only one set of requirements for an award for all of the scouts. I guess I am not sure how to set that relationship up. I think I should have Awards and Requirements in objects. then have an Answers (or work object) that ties to a requirement.

Something like:

I would welcome any comments, guidance, or assistance of any kind.


(Austin ) #2

I generally solve this with a combination of the gems rolify and pundit. Instead of having a scouts table, it would be user. Then a user has many roles.

Pundit defines permissions on restful actions and defines scopes for the roles.