Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRUD courses - Model creation #5

Closed
EmCousin opened this issue Aug 15, 2019 · 0 comments
Closed

CRUD courses - Model creation #5

EmCousin opened this issue Aug 15, 2019 · 0 comments
Assignees

Comments

@EmCousin
Copy link
Owner

EmCousin commented Aug 15, 2019

As an Admin, I want to be able to Create, Read, Update and Destroy courses.

Model Creation

For that, I would like the courses to be managed in the databased via a table courses, that would be mapped by an ActiveRecord model Course.

A Course should have the following attributes :

  • title : the title of the course
    • Type :string
    • Required
    • Example : Lundi Adulte Mixte
  • description : the description of the course
    • Type :string
    • Optional
  • capacity : the numbers of people who can subscribe to this course
    • Type : integer
    • Required
  • category : the category of the courses
    • Type : string
    • Required
    • Only these values are possible :
      • Adulte
      • Adolescent (13 - 15 ans)
      • Adolescent (10 - 12 ans)
      • Kidz (6 - 9 ans)

Tips

  • You can generate the model Course with its attributes this way : rails generate model Course title description type:integer category
  • Make sure that the fields that are required are set to null: false in the migration file that will be generated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants