开发者

Is it possible to put all data access related methods in a separate class?

I like ha开发者_运维技巧ving separate classes, one class represents the entity, and that a separate DAO (database access object).

Is this possible with rails and active record?


Most of what you would put into a DAO is already hidden inside of ActiveRecord anyway, so there's not much of a need to split these up. But, if you insist you can split out whatever methods you want into a separate Module and then include it in your model.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜