/micro-reddit

Ruby on Rails - micro-reddit users, posts, comments

Primary LanguageRuby

Project : Active records in Rails

The project aims to provide a deeper understanding on model in active record by building a Micro-Reddit app. Associations are very simple and illustrated below:

  • User owns Posts & Comments
  • Post has to belong to a User & Post can have many Comments
  • Comments must belong to a Post & a User

reddit

Built With

  • Ruby on Rails

Getting Started

Model generated:

  • user
  • comment
  • post

Requirements

    1. Ruby (~v2.6.3 or more recent) installed in your machine.
    1. Rails

Setup

  • To clone this repository, open your Terminal and execute the following command:
git clone https://github.com/smy5152/micro-reddit.git

Run

  • Change into the folder
cd micro-reddit
  • Install gems
bundle install
  • Run Database migrations
rails db:migrate

How to use it

  • Run Rails console
rails console

To start testing the models, execute the following commands from the Rails console. We have added some default content in each Model.

  • User.all
  • Post.all
  • Comments.all

Authors

🧑‍💻 Shabbir

🧑‍💻 Varun

🤝 Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the issues page.

Show your support

Give a ⭐️ if you like this project!

Acknowledgments

📝 License

This project is MIT licensed.