我想要做的關係:Rails的mailboxer通知關係
has_many :notifications, foreign_key: :notified_object_id, conditions: {notified_object_type: 'AppShare'}, dependent: :destroy
這個網頁上找到:http://blog.meldium.com/home/2013/4/22/dont-spam-your-users-batch-notifications-in-rails
我已經把它改爲:
has_many :notifications, -> { where(notified_object_type: 'Assigment') }, foreign_key: "notified_object_id", dependent: :destroy
由於軌道4語法,但我得到這個:
uniniti alize constant Assigment :: Notification
有人能幫我一下嗎?
謝謝