0
 # Movie Model
 has_many :purchases
 has_many :buyers, through: :purchases

 # User Model
 has_many :purchases, foreign_key: :buyer_id
 has_many :movies, through: :purchases

 # Purchase Model
 belongs_to :movie
 belongs_to :buyer, class_name: 'User'

http://www.sitepoint.com/build-online-store-rails/

How show movies list where purchases is nil?

0 Answers0