Git Product home page Git Product logo

todo_challenge's Introduction

Checkpoint

This is an open-book checkpoint practice focusing on building a simple TODO ruby app using ActiveRecord with SQL database.

Purpose

The test is to ensure that you are familiar with the basics of ActiveRecord, and how it works with database (sqlite3 in this case) using Ruby.

To start:

  1. FORK this repo out by clicking the "Fork" button on the top right side of the GitHub page.
$ cd ~/Desktop
  1. Git clone your own forked repo.
$ git clone <your repo address>
  1. Navigate into the repo.
$ cd <repo-name>
  1. Start writing your code on "todo.rb" file
Remember to commit small and often. Some good references:
$ git add .
$ git commit
    - i
    - Write your commit message
    - Esc
    - :wq!
$ git push origin master

App Requirements:

Example:

1) User is able to add new task into the todo list

$ruby todo.rb --add <Description> <Status> 

Example:

$ ruby todo.rb --add "buy groceries" "undone"
$ ruby todo.rb --add "fuel my car" "undone"

2) User is able to list all the tasks:

$ ruby todo.rb --list
No.   Description     Status
===   ===========     =====
1.    Buy Groceries   Undone
2.    Fuel My Car     Undone

3) User is able to update the task descriptions and status

ruby todo.rb --update <No.> <Description> <Status>

This will update the task description with the mentioned task number. If the task is not found, a friendly error should be raised.

Example:

$ ruby todo.rb --list
No.   Description     Status
===   ===========     =====
1.    Buy Groceries   Undone
2.    Fuel My Car     Undone
$ ruby todo.rb --update 1 "Buy Fruits" "Done"
$ ruby todo.rb --list
No.   Description     Status
===   ===========     =====
1.    Buy Fruits      Done
2.    Fuel My Car     Undone
$ ruby todo.rb --update 4
> Task number 4 is not found. Are you sure that this is the right task number?

4) User is able to remove any task from todo list

ruby todo.rb --remove <No.>

This will delete the task with the corresponding number from the list. If the task is not found, a friendly error should be raised.

Example:

$ ruby todo.rb --list
No.   Description     Status
===   ===========     =====
1.    Buy Groceries   Done
2.    Fuel My Car     Undone
$ ruby todo.rb --remove 1
$ ruby todo.rb --list
No.   Description     Status
===   ===========     =====
1.    Fuel My Car     Undone
$ ruby todo.rb --remove 3
> Task number 3 is not found. Are you sure that this is the right task number?

IMPORTANT NOTE:

  • Take note of the Task number. Upon deletion, it should be SELF-UPDATED in an ascending order. Hmm, but changing the task's id inside your database is never a good idea. How can you self-update the number without changing the task's id?

At the end of this assessment, you should be able to:

1) Understand how ARGV works
2) Apply ActiveRecord and Sqlite3 into ruby application
** WITHOUT using SQL statement (refer Rakefile)
3) Able to create SQL database
4) Able to perform schema migration
5) Able to explore sqlite3 database
6) Able to CREATE, READ, UPDATE, DELETE (CRUD) data into SQL database
7) Able to rename files correctly (capitalization, camel case etc)

Good Luck!!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.