I'm trying to make an app in Rails 4 using psql database.
I've created three models for Project, Scope and Background.
The relationships between them are:
Project has one Scope Scope has one Background, and belongs to Project Background belongs to Scope
I can't figure out how to read the psql documentation. I have connected to the database and now want to search for background based on the project id.
My problems are:
I only know how to run one search in psql - that is SELECT * FROM "backgrounds"; I want to know how to search for a specific record in the background table
I don't have a project_id foreign key in my background table. I have a scope_id foreign key. However, I want to search for the project's background.
How do I search in psql, in the command line, for background, where project id = 5?
Thank you