Hello !

I've a question regarding Rails and Active Record. 

I've a class, for instance "Host" witch is populated with data from a 
remote API. I call a specific address and create my object. My object has a 
specific and unique ID. 

I would like to add additional data to this object. This data would be 
stored in my MySQL database. I want to only store this additional data in 
my database and do the link with my ID.

My idea for a Rails POV is to add an extra parameter in my “Host” class 
with something like “host_extra” whitch is an ActiveRecord::Base class with 
my extra data and in my constructor in my Host class I do a 
HostExtra.find(id). 

 

What do you think of my solution? A better solution exists to do something 
like that?



Thanks!

Regards,

 

-- 
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-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/293d58d4-0a42-47ed-91c1-6895447512e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to