Anyone have ideas on this one: I have a module that I include in two models. Each of these models do the same validation so I tried to put the shared validate method in the module. Problem is that this validate never gets called. Scary thing is that it does get called in my unit tests. I am on 14.3 recently upgraded from 13.1 Can anyone explain this? Thanks, Dave
Nathaniel S. H. Brown
2005-Nov-16 09:13 UTC
RE: def validate in a module does not get called
Please send us some code to look at. It is pretty hard to debug it with the information you gave. My guess is that you are accessing the validations differently between the two, subtly. But I would have to see the code to verify. Warmest regards, Nathan. -------------------------------------------------------------- Nathaniel S. H. Brown Toll Free 1.877.4.INIMIT Inimit Innovations Phone 604.724.6624 www.inimit.com Fax 604.444.9942> -----Original Message----- > From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of > David Clements > Sent: November 15, 2005 11:52 PM > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: [Rails] def validate in a module does not get called > > Anyone have ideas on this one: > > I have a module that I include in two models. Each of these > models do the same validation so I tried to put the shared > validate method in the module. Problem is that this validate > never gets called. > > Scary thing is that it does get called in my unit tests. > > I am on 14.3 recently upgraded from 13.1 > > Can anyone explain this? > > Thanks, > > Dave > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On 11/16/05, Nathaniel S. H. Brown <nshb-wgYSSEAWXinQT0dZR+AlfA@public.gmane.org> wrote:> Please send us some code to look at. It is pretty hard to debug it with the > information you gave. > > My guess is that you are accessing the validations differently between the > two, subtly. But I would have to see the code to verify. > > Warmest regards, > Nathan. > > -------------------------------------------------------------- > Nathaniel S. H. Brown Toll Free 1.877.4.INIMIT > Inimit Innovations Phone 604.724.6624 > www.inimit.com Fax 604.444.9942 > > > > -----Original Message----- > > From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of > > David Clements > > Sent: November 15, 2005 11:52 PM > > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > Subject: [Rails] def validate in a module does not get called > > > > Anyone have ideas on this one: > > > > I have a module that I include in two models. Each of these > > models do the same validation so I tried to put the shared > > validate method in the module. Problem is that this validate > > never gets called. > > > > Scary thing is that it does get called in my unit tests. > > > > I am on 14.3 recently upgraded from 13.1 > > > > Can anyone explain this? > > > > Thanks, > > > > DaveLooks like the problem was that the module class was not getting reloaded automatically. A restart of WebBrick made it all happy now. Thanks, Dave