私はRails 4の関連付けについて助けが必要です。私は、次の4つの機種があります。Rails 4 Associations:データベース設定の手助け
class User < ActiveRecord::Base
has_many :check_ins
has_many :weigh_ins, :through => :check_ins
has_many :repositionings, :through => :check_ins
end
class CheckIn < ActiveRecord::Base
belongs_to :user
has_one :weigh_in
has_one :repositioning
end
class Repositioning < ActiveRecord::Base
# belongs_to :user
belongs_to :check_in
end
class WeighIn < ActiveRecord::Base
# belongs_to :user
belongs_to :check_in
end
質問:私はこのよう設定していた場合は、どのように私は入力repositionings
、別途weigh_ins
が、それでも彼らは、単一のチェックを介して連結されているのでしょうか?