0

2 つのフィールドが検証されるモデルがありますが、そのうちの 1 つだけが必須です。

次の検証を書きましたが、機能していません。

  validates_presence_of :results, :on => :update, :if => Proc.new { |order| order.results_image? }
  validates_presence_of :results_image, :on => :update, :if => Proc.new { |order| order.results? }
4

1 に答える 1