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

validates vs validates..._of ... #571

Closed
mathiasuhl opened this issue May 25, 2016 · 2 comments
Closed

validates vs validates..._of ... #571

mathiasuhl opened this issue May 25, 2016 · 2 comments

Comments

@mathiasuhl
Copy link

Hi, who did decide that validates with params is better then ie. validates_presence_of and why? I think its less readable and more complex to comprehend.

@WaKeMaTTa
Copy link

WaKeMaTTa commented May 25, 2016

Because is more readable and you can put than 1 validation. And is more ruby style. Example:

validates :tag, presence: true, in: %w(best done wonderful)

@bbatsov
Copy link
Collaborator

bbatsov commented Dec 12, 2016

In general Rails-related tickets should be filed for the Rails style guide https://github.com/bbatsov/rails-style-guide

@bbatsov bbatsov closed this as completed Dec 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants