Extend ReturnVO with non-ActiveRecord Attributes

0 views
Skip to first unread message

lars

unread,
Apr 25, 2008, 10:21:37 AM4/25/08
to rubyamf
Hey Community,

I am new to the Ruby und RubyAMF world, so I hope someone can tell me
if and how I can do this.

I have a Flex ValueObject mapped to an ActiveRecord Model on the ruby
side. So this means that the attributes are mapped to the columns of
the database table. This works really fine! Now I need to extend the
model to return some values that do not need to be stored in the
database, lets say the array of validation errors. So I extend the
flex Value Object with that attribute (can be of Type object) and
added that property to the corresponding active record model in ruby
using attr_writer and attr_reader. Unfortunately, when sending this
object back to flex, the attributes added this way are not send and /
or transformed to the flex side. What do I need to do to achieve this?

Thx for any help on this! ;-)

Lars

Tony Hillerson

unread,
Apr 25, 2008, 1:48:35 PM4/25/08
to rubyamf
I added a feature to the version in branches/development that lets you
define methods to translate into AMF properties in the class mappings:

:methods => ['foo']

calls the foo method and turns it into an AMF property.

Try out that and tell me what you think.

lars

unread,
Apr 28, 2008, 8:03:48 AM4/28/08
to rubyamf
Hi Toni,

this is what I needed, your solution fits perfectly well, thanks ;-)
Reply all
Reply to author
Forward
0 new messages