I'm running into an issue when trying to associate two records via a belongs_to:
class Enrollment < ActiveRecord::Base
belongs_to :offering,
foreign_key: [:term_id, :class_number]
end
@enrollment = Enrollment.new
@enrollment.offering = Offering.last
This throws:
ActiveModel::MissingAttributeError: can't write unknown attribute `[:term_id, :class_number]'
What am I doing wrong?