Same here... complaining about unknown options would help, but I'd also maybe suggest renaming "validate" to something like "validate_with", which I think would be even more readable...
On Saturday, November 3, 2012 12:57:26 PM UTC-4, Henrik N wrote: > > > > My main issue with "validates" is that it's easy to mix up with "validate" > ( > http://apidock.com/rails/v3.2.8/ActiveModel/Validations/ClassMethods/validate > ). > > If you accidentally do "validate :title, presence: true", it will > effectively do nothing, and won't explode - it will call the "title" method > and expect that method to add validation errors, and "presence: true" just > becomes an ignored option. > > Tests will catch this, of course, but it's still an easy mistake to make. > > I'm not sure what would be a good solution, though. Maybe complaining > about unknown options? > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/2SglPpDaanYJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
