我們計劃升級我們的應用程序到Rails3。我們用過的很多插件是nested_has_many_through。這個插件看起來過時了,不再維護,而且看起來並沒有在新的Rails3應用程序中工作。Rails3嵌套has_many通過問題
一個簡單的例子:
Author.rb
has_many :posts
has_many :categories, :through => :posts, :uniq => true
has_many :related_posts, :through => :categories
Post.rb
belongs_to :author
belongs_to :category
Category.rb
has_many :posts
誰能推薦的最佳實踐的方式來處理這個問題,或者工作Rails3中的插件?
謝謝!
哈哈我剛找到你的fork http://github.com/releod/nested_has_many_thr記得這個問題,並且來到這裏告訴你所有關於叉子的事情。然後我看到了你的用戶名。良好的工作,我剛剛在我的Rails 3應用程序上進行了測試,它(大部分)都在工作。 我一直花費整晚試圖直接修補Rails根據https://rails.lighthouseapp.com/projects/8994/tickets/1152-support-for-nested-has_many-through-associations但卡住了。我將以叉作爲模板開始,現在我可能會更進一步! – 2010-09-23 13:24:49
+1 http://github.com/releod/nested_has_many_through你的rails3 fork也適用於我,直到rails 3.1 – clyfe 2011-03-21 15:26:25