Coder Social home page Coder Social logo

landlord-2's Introduction

Landlord Part 2

Part 2 - Active Record and Schema

  • Create a landlord_schema.sql It should contain the following:

    • Tenants table (with the follow attributes):

      • id
      • name
      • age
      • gender
      • apartment_id
    • Apartments table (with the follow attributes):

      • id
      • address
      • monthly_rent
      • sqft
      • num_beds
      • num_baths
  • Create the landlord database and load the schema to it.

  • Connect to the database with ruby

  • Define AR classes /w associations in the models folder for:

    • Tenant
    • Apartment
  • Create a Seed file that (follow comments in seed.rb):

    • Creates at least 3 instances of the apartment class
    • Creates at least 9 instances of the Tenant class. At least 5 should belong to an apartment
    • queries for all instances of the Tenant class and stores it in a variable of your choice
    • queries for all instances of the Tenant class that belong to one of the Apartments you created and stories it in a variable of your choosing.
    • Updates attributes using attribute helper methods for one of the objects you've created
    • Saves an object that you updated using attribute helpers to the Database
    • Updates an object using the update methods
    • Deletes one of the objects you've created

bonus

  • Create a commandline application that utilizes what you know about AR in order to create new apartments and people.

mega bonus

  • extend functionality of the command line app where you, the landlord, can assign people to apartments, evict tenants, change rent and .... whatever you want!

landlord-2's People

Contributors

andrewsunglaekim avatar jshawl avatar

Watchers

 avatar  avatar

Forkers

edwardpark

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.