This project is archived and is in readonly mode.
ActiveResource validations
-
Neeraj Singh
- State changed from new to resolved
- Importance changed from to Low
ActiveRecord and ActiveResource clears all the errors when .valid? is called. Right now I am not able to locate the code but I know that's what happens.
-
Matt Jankowski
ActiveResource calls super - https://github.com/rails/rails/blob/master/activeresource/lib/activ...
ActiveModel does the clear - https://github.com/rails/rails/blob/master/activemodel/lib/active_m...
So I guess my issue isn't with how or where that's happening, rather - why does it work that way, and is there a way to do what I wanted to do?
-
Neeraj Singh
I guess one reason I need the current behavior is to be able to do this.
c = Car.new c.valid? #=> false c.name = 'Honda' c.valid? #=> trueIf the errors are not cleared then manually I will have to clear it.