On Mon, Apr 23, 2007 at 04:21:24AM +0200, Yaxm Yaxm wrote:
> Jens,
> can you tell me what's wrong with my attemp to define accessors in a 
> not-so-tedious way?
> 
> With my Task active record model, I try to define accessors for 
> first_name and last_name:
> 
>   def Task.my_new_accessors(object, attributes)
>     attributes.each do |v|
>         define_method( v.to_sym ) do
>           (object).send v.to_s
as the error tells you, you call last_name on the Symbol :user here.
            self.send(object).send(v)
should work (not tested, though).

Jens

-- 
Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[EMAIL PROTECTED] | www.webit.de
 
Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to