分享 rails edge 可以让你在一个 column 存 Hash,ActiveRecord::Store

xds2000 · 2011年12月31日 · 最后由 huacnlee 回复于 2012年02月04日 · 2477 次阅读

Store gives you a thin wrapper around serialize for the purpose of storing hashes in a single column. It's like a simple key/value store backed into your record when you don't care about being able to query that store outside the context of a single record.

http://edgeapi.rubyonrails.org/classes/ActiveRecord/Store.html

数据存放看起来是通过序列号成字符串存储的

需要 登录 后方可回复, 如果你还没有账号请 注册新账号