LoginSignup
11
4

More than 1 year has passed since last update.

#Rails / ActiveRecord / 複数形の validates メソッドと 単数形の validate メソッドの違いは? 前者が標準のvalidatorで後者がカスタムのvalidator。

Last updated at Posted at 2020-04-01

びっくりするぐらい分かりにくいが、きっと命名的に苦慮の末だったのだろう。

validates (標準)

おなじみのやつ。

image

validate (カスタム)

こちらは自分でModelにメソッドを作って、ちっちゃなカスタムバリデーターを作る。

Active Record Validations — Ruby on Rails Guides

image

Original by Github issue

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

11
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
4