[英]Multiple associations with rails Audited
我正在使用Rails的Audited gem,並且正在使用相關的審計,如下所示:
audited allow_mass_assignment: true, associated_with: :protocol
問題是,我需要將此特定模型的審計與多個模型相關聯。 我希望這樣的事情能起作用:
audited allow_mass_assignment: true, associated_with: [:protocol, :patient]
但事實並非如此。 它提供了明確的錯誤說明:
[:protocol, :patient] is not a symbol nor a string
我可以找到的唯一相關頁面聲稱這根本不可能,但是它已經很老了,我希望有一些解決方法。
一如既往地提供任何幫助。
尚未測試,但可以在單獨的行上嘗試,例如:
audited allow_mass_assignment: true, associated_with: :protocol
audited allow_mass_assignment: true, associated_with: :patient
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.