The topic sounds a little awkward, but there’s really a gem called Her
Here’s the official documentation
http://www.her-rb.org/
Installation
In your Gemfile, add
1 | gem "her" |
I specified the faraday
version to be locked at ~> 0.8.10
because there’s something wrong the the newest version so far.
Usage
1 | # config/initializers/her.rb |
And then to add the ORM behavior to a class, you just have to include Her::Model
in it:
1 | class User |
After that, using Her is very similar to ActiveRecord:
1 | User.all |
Customization
For custom primary key:
1 | class User |
For custom collection path:
1 | class User |
For custom association:
1 | class User |