rails model do something on destroy -


how can go writing method in model should called right before model destroyed?

for example want write loop update bunch of stuff in model b when model a destroyed

that's callbacks for, in case can use before_destroy callback such as:

class modela before_destroy :do_bunch_of_things  def do_bunch_of_things ... end end 

Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -