Code Monkey home page Code Monkey logo

hs-activerecord-assessment's Introduction

ActiveRecord Costume Store

Objectives

jack o lantern emoji dog ghost emoji jack o lantern emoji

For this morning's todo, you'll be creating the following tables: 'costumes','costume_stores', and 'haunted_houses'. You be creating the following classes: Costume, CostumeStore, and HauntedHouse. Each table will have three columns.

The costumes table will have:

  1. name
  2. price
  3. size

The costume_stores table will have:

  1. name
  2. location
  3. number of costumes, or "costume inventory"

The haunted_houses table will have:

  1. name
  2. location
  3. theme

Instructions

File Structure

You will only be altering code in six files, the three files in the models folder and the three files in the db/migrations folder.

├── app
│   └── models
│       ├── costume.rb
│       ├── costume_store.rb
│       └── haunted_house.rb
└──db
    └── migrations
        ├── 001_create_costumes.rb
        ├── 002_create_costume_stores.rb
        └── 003_create_haunted_houses.rb

Getting Started

This is a test-driven lab so start with the first test and work your way down.

Your models should be no longer than two lines of code.

  • The first step is to run bundle install.
  • Create the Costume class in app/models/.
  • Fill out the ActiveRecord migration for costumes such that it passes the specs.
  • Create the CostumeStore class in app/models/.
  • Fill out the ActiveRecord migration such that it costume_stores the specs.
  • Create the HauntedHouse class in app/models/.
  • Fill out the ActiveRecord migration for haunted_houses such that it passes the specs.
  • Remember to run rake db:migrate every time you create a migration.
  • Just like for any other lab, run rspec to view your progress.

Resources

View ActiveRecord Costume Store on Learn.co and start learning to code for free.

hs-activerecord-assessment's People

Contributors

changamanda avatar deniznida avatar fislabstest avatar fs-lms-test-bot avatar ipc103 avatar kthffmn avatar rolandobrown avatar roseweixel avatar sarogers avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.