CS169: Software Engineering
October 14, 2013
❏ Complete mid semester survey
❏ Sign up for face to face project meetings with GSI
❏ models must have attribute for foreign key
❏ ActiveRecord manages it, not you!
❏ For one-to-many association:
❏ Add has_many to owning model and belongs_to to owned model
❏ Create migration to add foreign key to owned side that references owning side
❏ Apply migration
❏ rake db:test:prepare to regenerate test database schema
❏ but what about multiple associations?
❏ add multiple “has_many” and “belongs_to”
❏ Mvigor asmay reies
❏ Mvi hs_an :evews
❏ Rviw elng_t :oveger
❏ Rviw elng_t :ove
❏ but how would we get all the movies reviewed by a moviegoer?
❏ moviegs_an :oves