On Apr 23, 4:02 am, Kedar Mhaswade <[email protected]> wrote:
> In order to understand exactly when the various model validators are
> called, I installed ruby-debug and added “debugger” just before say
> validates_numericality field of a model (say Product). I see that this
> gets called (debugger break-point is reached) when I am just “Show”ing
> the products (e.g.http://localhost:3000/products/4). It’s counter-
> intuitive to me that just showing (not updating) a product should
> result in a call to model validation.
>
> Can someone please explain?

It would help if you could show your model, and perhaps look at the
stack trace when you hit your breakpoint. To me it sounds like you've
got

class Product
  ...
  debugger
  validates_numericality_of ...
end

That breakpoint won't get hit when validations run, it will get hit
when the class is loaded.

Fred
>
> -Kedar
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
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-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to