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
        end
    end
  end

 my_new_accessors :user, [ :last_name, :first_name]


But I got the following errors:
>> Task.new.last_name
NoMethodError: undefined method `last_name' for :user:Symbol

Thanks.

-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to