Re: Setting a message on a model -without- errors.add_to_base

Sharagoz
2010-04-30T09:37:25Z

On Apr 30, 12:21 am, Phoenix Rising
<polarisris...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
> The only thing I''ve thought about so far is setting a virtual
> attribute of some kind, but I''d like to see if anybody has a
better
> idea before I jump straight to that.

I think a non-DB ("virtual") attribute is a good idea.
Simply declare the attributes with attr_accessor.

class Order < AR::B
  attr_accessor :my_attribute
end

This will add the initialization of the instance variable and create
getters and setters.

--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at