This application is a mock version of Trello API, where a client can use the provided RESTful APIs to generate lists.
ruby 2.2 or higher
rails 5.0 or higher
rack-cors
for cross origin resource sharing (CORS)bcrypt
for authenticationactive_model_serializers
to turn it as a JSON Objects
- Removed auto-generated
foreign_key: true
inrails g
and addedadd_foreign_key
in the migrations file explicitly for the non-standard naming of creator_id, and assignee_id
- User
# bcrypt authentication
has_secure_password
# Nullify turns dependent foreign keys into null if the reference_key gets removed.
has_many boards, foreign_key: 'creator_id', dependent: nullify
has_many lists, foreign_key: 'creator_id', dependent: nullify
has_many cards, foreign_key: 'creator_id', dependent: nullify
has_many comments, foreign_key: 'creator_id', dependent: nullify
- Board
belongs_to :creator, class_name: 'User'
has_many :lists, dependent: :destroy
- List
belongs_to :board
belongs_to :creator, class_name: 'User'
has_many :cards, dependent: :destroy
- Card
# Optional true turns off the validation for the foreign_key
belongs_to :list
belongs_to :creator, class_name: 'User'
belongs_to :assignee, class_name: 'User', optional: true
has_many :comments, dependent: :destroy
- Comment
belongs_to :card
belongs_to :creator, class_name: 'User'
They all have basic validation in place such as email uniqueness & presence, title presence(board,list,cards) and body presence for the comments.
To be updated..
Clone & Bundle and you are ready to use the Jello service!
-
GET '/users/:id'
- Returns the user information