A good chunk of what makes up a Rails model lives not in ActiveRecord
, but in ActiveModel
.
class ExternalArticle
include ActiveModel::Model
end
will give you functionality like validations, callbacks, compatibility with URL helpers and so on.
See Railscast #219 for a short overview.
However, ActiveModel does not give you associations to other models. If you need those, the activerecord-tableless gem might help.
Edit:
I see now that your non-persisted model objects come from a REST API. Take a look at ActiveResource as well; it used to be part of Rails, but has been extracted into a separate gem as of Rails 4. It is basically ActiveRecord for remote objects.