Forum: Ruby on Rails def validate in a module does not get called

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
digidigo (Guest)
on 2005-11-16 09:52
(Received via mailing list)
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
Nshbrown N. (Guest)
on 2005-11-16 11:14
(Received via mailing list)
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
digidigo (Guest)
on 2005-11-18 17:21
(Received via mailing list)
On 11/16/05, Nathaniel S. H. Brown <removed_email_address@domain.invalid> wrote:
> Nathaniel S. H. Brown                 Toll Free 1.877.4.INIMIT
> > Subject: [Rails] def validate in a module does not get called
> > I am on 14.3  recently upgraded from 13.1
> >
> > Can anyone explain this?
> >
> > Thanks,
> >
> > Dave


Looks like the problem was that the module class was not getting
reloaded automatically.  A restart of WebBrick made it all happy now.

Thanks,

Dave
This topic is locked and can not be replied to.