简体   繁体   English

没有数据库的Active Record

[英]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. 但我发现在我的项目中拥有所有Active Record工具(验证,关联等)会很好。

How to setup Active Record to not use database at all? 如何设置Active Record根本不使用数据库?

Ryan Bates in 219 cast "The Active Model" described only validation part but I need association facility. Ryan Bates在219演员“活跃模型”中仅描述了验证部分,但我需要协会设施。

Take a look at ActiveModel . 看看ActiveModel That's what AR uses under the hood. 这就是AR在引擎盖下使用的。

These two gems could be what you want: 这两个宝石可能是你想要的:

activemodel-associations activemodel的-协会

activemodel activemodel的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM