カレーの恩返し

おいしいのでオススメ。

2016-12-16から1日間の記事一覧

多対多の相手レコード数の最小を指定するバリデーション

こんなクラス構造 class Hoge < ApplicationRecord has_many :hoge_foos has_many :foos, through: :hoge_foos accepts_nested_attributes_for :hoge_foos end class Foo < ApplicationRecord has_many :hoge_foos has_many :hoges, through: :hoge_foos end…