On 3 March 2016 at 20:25, Zdravko Balorda <
li...@ruby-forum.com> 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
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to
rubyonra...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/049afd0291e817ad42d87dd720ffd0a0%40ruby-forum.com.
> For more options, visit
https://groups.google.com/d/optout.