Skip to content

Instantly share code, notes, and snippets.

@cherring
Created December 30, 2010 01:53
Show Gist options
  • Select an option

  • Save cherring/759350 to your computer and use it in GitHub Desktop.

Select an option

Save cherring/759350 to your computer and use it in GitHub Desktop.
class KlassB
def do_something
save
send email or some such thing
end
end
class MyKlass
after_save :do_something, :if => :condition_for_callback
def do_something
send_email or some such thing
end
def condition_for_callback
send or not?
end
end
@andys
Copy link

andys commented Dec 30, 2010

if the condition_for_callback function is going to be used for other stuff, thats cool. or if it'll make it easier to test. if not, it seems like things are getting complex/verbose a bit early perhaps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment