This program implements a basic active record action in ruby on rails with three model classes and assoications between these models
-
Author model: The author model implements four validation for the authors table: - Presence of all fields when adding an author - Username must be unique and length between 4 - 12 - Password must of length between 6 - 16 - email must be unique
-
Post model: The post model implements a validation for the posts table: - Presence of all fields when adding a post
-
Comment model: The post model implements a validation for the comment table: - Presence of all fields when adding a post
Program implements 2 main association: Has_many and the belongs_to
- A post has many comments
- An author has many posts
- An author has many comments
- A post belongs to an Auhtor
- A comment belongs to a post
Additional description about the project and its features.
- Ruby on Rails
- GitHub: @githubhandle
- Twitter: @twitterhandle
- LinkedIn: LinkedIn
- GitHub: @githubhandle
- Twitter: @twitterhandle
- LinkedIn: LinkedIn
To get a local copy of the repository please run the following commands on your terminal:
- open terminal
- $ git clone 'https://github.com/ashraffares/micro-reddit'
- cd into micro-reddit
- cd into reddit
- run bundle install
- rails db:migrate
Give a ⭐️ if you like this project!!