finds.dev← search

// the find

remi/her

★ 2,082 · Ruby · MIT · updated May 2024

Her is an ORM (Object Relational Mapper) that maps REST resources to Ruby objects. It is designed to build applications that are powered by a RESTful API instead of a database.

Her maps REST API endpoints to Ruby model objects using an ActiveRecord-like interface, built on top of Faraday. It's a replacement for the deprecated ActiveResource gem, aimed at Rails apps that consume external APIs rather than talk directly to a database. The middleware-based design means you can plug in auth, caching, and custom parsers without touching the core.

The Faraday middleware stack is the right call — it means you get OAuth, caching, custom JSON parsing, and SSL without Her needing to implement any of it. Association handling is genuinely smart: if the API embeds related data in the response, no extra HTTP request fires; it only fetches lazily when needed. Multiple API instances (`use_api MY_API`) solve the real-world problem of an app consuming more than one external service without global config pollution. The test story is clean — swapping the Faraday adapter for a stub lets you test models without any HTTP.

Validations are a trap: `ActiveModel::Validations` is included but validations are NOT run on save or create, so `user.save` will POST even if `user.valid?` is false — this will bite anyone coming from ActiveRecord without reading the docs carefully. Last meaningful activity is 2024 with 2082 stars but sparse recent commits; the ecosystem has moved toward purpose-built API clients and GraphQL, so this is a niche that's shrinking. Error handling from the API is weak — `response_errors` is an array you have to check manually, there's no standardized way to surface HTTP 4xx/5xx as exceptions unless you write your own middleware. Nested resource paths require all parent IDs to be present on the object at all times, which creates fragile coupling between your models and the exact URL structure of the upstream API.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →