Friday 15 July 2011

ruby on rails 4 - How to couple activeresource object with activerecord 'same' object? -



ruby on rails 4 - How to couple activeresource object with activerecord 'same' object? -

i'm wondering if there's efficient , elegant way 'link' activeresource object activerecord object.

i'm installing payment scheme application, works api contains user table, wallet table, ... want store info in application database. eg: - when create wallet_object_api_side, want store in wallet_object_my_database - when update wallet_object_api_side, want update wallet_object_my_database

wallet_object_api_side must equal wallet_object_my_database

is there elegant way both creating api object , saving in database in same request ?

thank you.

you can rails callbacks.

but bigger question why trying this? it's unsafe rely on replicating remote info locally , vice versa. if api definitive source of data, should go api when need data.

what if changes in api database; how application going know , deal it?

ruby-on-rails-4 activeresource

No comments:

Post a Comment