Giter Club home page Giter Club logo

moma_db's Introduction

MOMA App

This app will have 2 models: Artists and Paintings. An Artist has many paintings, and a Painting belongs to an Artist.

An Artist has

  • name
  • nationality

A Painting has

  • title

###Part 1 - Database Schemas

  1. Create a new database called moma_db.
  2. Create the schema to model Artists and Paintings.

###Part 2 - Setting up ActiveRecord

Create a Ruby program that creates an ActiveRecord interface for interacting with the artists & paintings.

Using a seed file, populate your database (using ActiveRecord) with at least 3 Artists and 3 Paintings (associated correctly):

'Starry Night' by Vincent van Gogh (Dutch)
'Guernica' by Pablo Picasso (Spanish)
'Water Lilies' by Claude Money (French)

###Part 3 - ActiveRecord Practice

Write the commands that you would enter in pry to do the following: Save the pry commands to a file called ar_commands.rb

  1. Create a new Artist (Vincent Van Gogh) and save him to your database

  2. Create a new Painting (Starry Night) and save it to your database

  3. Return all Artists

  4. Return all Paintings

  5. Return the artist with an id of 2

  6. Return the artist with a name of "Vincent Van Gogh"

  7. Return all the artists who are "Spanish"

  8. Return the painting with an id of 1

  9. Return the painting with a name of "Guernica"

  10. Return all the paintings that "Pablo Picasso" painted

  11. Return the artist of "Guernica"

  12. Change Vincent Van Gogh's nationality to "American"

  13. Change "Starry Night" to be one of Pablo Picasso's paintings

moma_db's People

Contributors

mkernsncr avatar robertakarobin avatar

Watchers

James Cloos 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.