[jifty-devel] Defining a virtual column

Ruslan Zakirov ruslan.zakirov at gmail.com
Fri Feb 12 19:29:01 EST 2010


Hi,

You just create a method:

sub full_name { $_[0]->first_name .' '. $_[0]->last_name }

On Sat, Feb 13, 2010 at 2:34 AM, Carlos Arenas <carlos.arenas at gmail.com> wrote:
> hello again.  as promised, i have more questions...
>
> i am creating a User model with first_name and last_name columns.  i
> would also like to create a virtual full_name column.  so far i have:
>
> column full_name =>
>    is virtual,
> ;
>
> but how do i define its value as "first_name.' '.last_name"?  i
> suspect "defer" might be involved, but i could not find any
> documentation or example of defer when applied to the same class.
>
> can someone please give me push in the right direction?  thanks.


-- 
Best regards, Ruslan.


More information about the jifty-devel mailing list