On Jan 22, 7:31 pm, snacktime <[email protected]> wrote:
> Yes that will work. I've been working on something very similar for an
> opensocial container, where I use models not tied to a database. I use
> something similar to this, although I also overrite save so you can validate
> on save.
>
> http://svn.viney.net.nz/things/rails/plugins/active_record_base_witho...
>
> Also, the built in json serializer has really bad performance, especially in
> it's association handling. I used the json gem and wrote my own code for
> serializing associations.
>
Chris,
I've been trying to use the active_record_base_without_table and it
seems to work okay, until I try to dynamically create the model
objects. At the moment I assign variables like so:
obj.instance_variable_set("@#{varname}", val)
However it seems that ActiveRecords don't hold values in variables,
but in an attribute hash. This seems to get set like so:
obj.method_missing("@#{varname}=", [val], nil)
But this doesn't seem to work at all.
Is there a way of programatically assigning values to ActiveRecord
columns?
Shak
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---