Re: no overloaded magic??
[prev]
[thread]
[next]
[Date index for 2004/09/15]
Quoting Perrin Harkins <perrin@xxxx.xxx>:
> On Wed, 2004-09-15 at 16:47, Michael Jensen wrote:
> > % if ($user->group_id < 4) {
> > some stuff here...
> > % }
> >
> >
> >
> > I have never heard of overloading before so I am not sure what isgoing
> > on. See error:
> >
> >
> > Operation `<': no method found,
> > left argument in overloaded package Table::Groups,
> > right argument has no overloaded magic
> > at/home/webtree/home/www.acutext.com/html/o/siteMenu.mas line 45.
>
> Looks like $user->group_id actually returns an object, not a simple
> scalar. Maybe you meant $user->group_id()->id() ?
>
> - Perrin
>
>
I had frequently run into this problem with fields that are in a has_a
relationship. If you print them, it stringify's the field, but if you do
comparisons, it will barf. Perrin's suggestion should do the trick.
-jason scott gessner
jason@xxxxxxxx.xxx
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.