I have a rails model where some part of data comes from database and other by calling a restful web service. Is there a way to use both ActiveRecord and ActiveResource in the same model to achieve this?
Ideally I would like to load the attributes that it gets from web service lazily (when accessed in controller) and only load the db attributes by default. Is it best if I create two models one that accesses service using ActiveResource and one with ActiveResource which :has_one
of the active resource model. Also, how to make sure I only call the service when only activeresource methods are accessed (like a before_filter but for only those methods - if I have a relationship with other model, doesn't rails already do that)?
Thanks in advance.