Skip to content

Instantly share code, notes, and snippets.

@harrisonmalone
Created May 20, 2020 02:43
Show Gist options
  • Save harrisonmalone/4d3d04e0cdaf2beefb0772137280e2c5 to your computer and use it in GitHub Desktop.
Save harrisonmalone/4d3d04e0cdaf2beefb0772137280e2c5 to your computer and use it in GitHub Desktop.

Explain 3 different high-level components (abstractions) in your app?

One example of a higher level component in my app is Active Record. Active record is a module with the Base class inside of it that gives our models methods through inheritance that allow us to manipulate data.

Essentially, active record can be called on our models to create, read, update and delete records. In the background it's executing SQL that does this record manipulation.

Active Storage is a module that allows me to upload files in a simple manner. It does the following...

Action View is the module that is responsible for rendering our views. It does the following...


Code Comments

# this action returns all of the listing records and sends them to the index view
def index 
  Listing.all	
end

# Load every game and its publishers username
# only load active games
games = []
list = Game.with_attached_images
  .includes(publisher: [:user])
  .select { |game| game.active == true }

Schema requirements

You must have:

  1. A screenshot of your ERD from dbdiagram
  2. Text for how you created the dbdiagram, put this into your db/ directory and call the file dbdiagram.dbml
  3. Discuss why you implemented your different tables and relations, explain how they work

Slides

  1. What is the problem you're trying to solve
  2. Why does this problem need solving
  3. Walk through your app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment