Groups
Groups
Sign in
Groups
Groups
Ruby on Rails Taiwan
Conversations
About
Send feedback
Help
before_destroy
1 view
Skip to first unread message
Egg
unread,
Aug 31, 2008, 6:08:11 AM
8/31/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ruby on Rails Taiwan
我在我的model中
使用了callback, 像是before_save, before_destroy
方法就是在model中定義一個method
link:
def before_save
.....
end
(before_destroy也一樣)
定義之後, before_save一切正常
但是before_destroy就完全不會被呼叫
連
def before_destroy
a = 3 / 0
end
都不會有錯誤產生
不知道有沒有人碰過這種問題
感謝您的幫助
Reply all
Reply to author
Forward
0 new messages