Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Active Record without database

My application doesn't need any database backend because it's kinda proxy server between client and another servers.

But I found that it would be nice to have all Active Record facilities (validation, associations and etc) in my project.

How to setup Active Record to not use database at all?

Ryan Bates in 219 cast "The Active Model" described only validation part but I need association facility.

like image 898
megas Avatar asked Dec 12 '12 11:12

megas


2 Answers

Take a look at ActiveModel. That's what AR uses under the hood.

like image 127
Jiří Pospíšil Avatar answered Sep 27 '22 00:09

Jiří Pospíšil


These two gems could be what you want:

activemodel-associations

activemodel

like image 21
Boti Avatar answered Sep 27 '22 00:09

Boti