Extending activeRecord with activeResource


#1

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


#2

On 3 March 2016 at 20:25, Zdravko B. removed_email_address@domain.invalid 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