recommendations has_many approvals
基本上是一個被推薦使用的批准創建的。可以批准的人進入並檢查批准框,並且需要爲需要批准的下一個人輸入電子郵件地址(電子郵件是批准的屬性)。
需要注意的是,如果current_user具有user_type = SMT,則不需要更多批准。這是最後的批准。
我使用的是建議/:id/approval /:id/edit動作。我認爲我只需要一個批准方法。喜歡的東西:
before_save :save_and_create
def save_and_create
Some code that saves the current approval, creates a new one and asks me for the next admins email address, and send that user an email requesting that they approve
end
任何幫助,將不勝感激
哦,我看到你想要一個類的批准方法..我會改變這一點。 – Lichtamberg 2011-12-19 23:11:41
這看起來像我正在嘗試做的第二部分...第一部分是保存並要求用戶發送新電子郵件...我可以處理髮送電子郵件,但不知道如何保存並創建另一個 – 2011-12-19 23:24:35
你的意思是,批准,當添加一個新的電子郵件地址時,批准應該向下一個批准者發送一個emial? – Lichtamberg 2011-12-20 00:17:57