简体   繁体   English

使用has_paper_trail_defaults将忽略添加到PaperTrail

[英]Adding ignore to PaperTrail using has_paper_trail_defaults

We currently have 我们目前有

PaperTrail.config.has_paper_trail_defaults = {
  on: %i(create update destroy)
}

but would like to have 但想拥有

PaperTrail.config.has_paper_trail_defaults = {
  on: %i(create update destroy),
  ignore: :updated_at
}

For some reason the ignore is getting ignored. 由于某种原因,忽略被忽略了。 Any suggestions? 有什么建议么?

I believe ignore expects an array (or a hash argument) 我相信ignore期望一个数组(或一个哈希参数)

try... 尝试...

ignore: [:updated_at]

Note that updated_at will still appear in a version record that was created for some other reason. 请注意, updated_at仍将出现在由于其他原因而创建的版本记录中。 If you never want it to appear in the version record, use skip 如果您不希望它出现在版本记录中,请使用skip

skip: [:updated_at]

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

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