responses/replies
, making it a tree of comments, that's why it is named as Comment Tree
self-referential classes
is used, to implement this Comment Tree
Authorization
and Authentication
, devise
is usedUser
can apply CRUD
operation on the Comments
User
image, active storage
is usedrspec
is usedVisit CONTRIBUTING.md for contribution to this project.
Visit LEARN.md for learning self-referential associations
and how it works in Ruby on Rails.
rails s
http://localhost:3000/graphiql
ruby 2.4.1
2.3.7
In this project, I've used the AWS S3 Bucket for storing the user
images. If you want the same functionality then you need to create your own S3 Bucket and add the required/relevant keys OR you can just set the storage to local
. It is important to set this up for your local machine, otherwise you might face errors while sign_up
or other places.
config/environments/development.rb
file and for the line: config.active_storage.service = :amazon_dev
replace :amazon_dev
with :local
.config.active_storage.service = :local
EDITOR="code --wait" bin/rails credentials:edit
aws:
access_key_id: "XXXX"
secret_access_key: "XXXX"
region: "us-east-1"
dev:
bucket: "BUCKET-NAME-DEV"
prod:
bucket: "BUCKET-NAME-PROD"
config/environments/development.rb
file and for the line: config.active_storage.service = :local
replace :local
with :amazon_dev
.config.active_storage.service = :amazon_dev
To setup the database for this project follow the steps below:
rails db:create
rails db:migrate
If you ran into issues, follow:
rails db:drop
rails db:create
rails db:migrate
To populate the database with some data use:
rails db:seed
rails s
.http://localhost:3000/
rspec
is used.rspec
rspec file_path