Rails - PSQL command line query -


i'm trying make app in rails 4 using psql database.

i've created 3 models project, scope , background.

the relationships between them are:

project has 1 scope scope has 1 background, , belongs project background belongs scope

i can't figure out how read psql documentation. have connected database , want search background based on project id.

my problems are:

  1. i know how run 1 search in psql - select * "backgrounds"; want know how search specific record in background table

  2. i don't have project_id foreign key in background table. have scope_id foreign key. however, want search project's background.

how search in psql, in command line, background, project id = 5?

thank you


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -