Extending activeRecord with activeResource

How to extend ActiveRecord from database with additional columns from
ActiveResource?
I have an ActiveRecord class Person which I need to extend with columns
from remote database which I can access with ActiveResource class Party.
Can Party be seemlessly integrated into Person?
Regards, Zdravko

On 3 March 2016 at 20:25, Zdravko B. [email protected] wrote:

How to extend ActiveRecord from database with additional columns from
ActiveResource?
I have an ActiveRecord class Person which I need to extend with columns
from remote database which I can access with ActiveResource class Party.
Can Party be seemlessly integrated into Person?

There may be other ways, but unless someone provides a better solution
I would setup a has_one belongs_to relationship between them, and then
if you really want to avoid having to do @person.party.field then
define accessor methods in Person so that @person.field references
self.party.field

Colin

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs