![](/img/trans.png)
[英]Rails: Specifying association type when saving tokens using collection_singular_ids=ids method
[英]Rails: What is the return type and value of the collection_singular_ids= method in a has_and_belongs_to_many association?
在Rails中使用has_and_belongs_to_many關聯時,它將向模型添加一個稱為collection_singular_ids=
的方法,其中collection_singular
必須用關聯表的單數名稱替換。
此方法的返回類型和值是什么? 我查看了API ,但沒有找到它。
只是繼續嘗試。 如果成功,它將返回您傳遞的id數組,否則返回nil。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.