This may be a dumb point, but I can’t find a solution.
I have a simple model with an update_menu
class method, and I want it to be called after every instance is saved.
Class Category attr_accessible :name, :content def self.menu @@menu ||= update_menu end def self.update_menu @@menu = Category.all end end
So what is the correct syntax for calling after_filter
update_menu
?
I tried:
after_save :update_menu
But he is looking for the method in the instance (which does not exist), and not in the class.
Thank you for your responses.
source share