簡體   English   中英

與Rails的多個關聯已通過審核

[英]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

對於任何搜索您是否可以將associated_with與多個關聯一起使用的人,當前是不可能的

雖然有人提交了PR ,但它沒有按預期工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM