Forum: Ruby on Rails [ANN] Integrative - for integrating ActiveRecord models with external resources

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
netizer (Guest)
on 2016-07-12 18:47
(Received via mailing list)
As I couldn't find the library for working with external resources in
Rails, I made this gem:

A long time ago I thought that that's what ActiveResource id for, but:
- There is no system of associations between ActiveResource models and
ActiveRecord models
- ActiveResource has a lot of features related to modifying external
resources, but I never found it particularly useful. Usually I just want
"enrich" my models with some content fetched from some (usually

To make it more clear, what you can use it for, here's an example:

  class User < ApplicationRecord
    include Integrative::Integrator

    integrates :relation, requires: [:with]

  class Relation
    include Integrative::Integrated

    def self.integrative_find(ids, integration)
      Friend.where(user_id: integration.call_options[:with].id,
other_user_id: ids)

  User.where(public: true).integrate(:relation, with:

The above code would fetch Friend models only once.

All feedback is welcome.

This topic is locked and can not be replied to.