I see that Mongoid supports read-only attributes. Is there a way to mark an entire document, or an entire collection / model class as read-only?
相关问题
- MongoDB can not create unique sparse index (duplic
- Question marks after images and js/css files in ra
- Using :remote => true with hover event
- Spring Data MongoDB - lazy access to some fields
- Eager-loading association count with Arel (Rails 3
相关文章
- mongodb有没有什么办法禁止读取数据的时候进行缓存
- mongodb-aggregate聚合查询分组后如何获得多字段
- Right way to deploy Rails + Puma + Postgres app to
- mongodb error: how do I make sure that your journa
- How to track MongoDB requests from a console appli
- AWS S3 in rails - how to set the s3_signature_vers
- how to call a active record named scope with a str
- How to add a JSON column in MySQL with Rails 5 Mig
You can access the
fields
class attribute and splat the hash's keys againstattr_readonly
. For example:Note that,
fields.keys
will include_id
and_type
.