Is fetch expected as well as connection choice?
I mean, can impatiently receive a has-many relationship cause 2 requests or one connection request?
How does an active record in rails implement association extraction associations because they don't know the table metadata first hand (I mean the columns in the table)? Say for example, I have
people - id, name things - id, person_id, name
man has a one-to-many relationship with things. So, how does it generate a query with all the column aliases, even if he cannot know it when I do data collection for people?
, , :
SQL- , ActiveRecord:: Base. "", , "". - . , .
, sql, , , . , Rails ( SQL) , main table join , sql. (, Human.join(: pets).where("people.name = 'John'))
Rails . , . , , , , . , , . , Rails 3, , , , , , .
. Ruby , / , . "person_id", "own_to: person" , "person_id" - , , "".
People.includes(: things), 2 , 1 , , , .
http://guides.rubyonrails.org/active_record_querying.html