Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
YumaInaura opened this issue Mar 31, 2020 · 0 comments

Comments

@YumaInaura
Copy link
Owner

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

validates (標準)

おなじみのやつ。

image

validate (カスタム)

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

Active Record Validations — Ruby on Rails Guides

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant