Skip to content

Instantly share code, notes, and snippets.

@mattdelacdev
Created March 21, 2014 03:47
Show Gist options
  • Select an option

  • Save mattdelacdev/9679144 to your computer and use it in GitHub Desktop.

Select an option

Save mattdelacdev/9679144 to your computer and use it in GitHub Desktop.
class Document < ActiveRecord::Base
after_commit :setup, on: :create
def setup
update foo: :bar if needs_to_update?
end
def needs_to_update
true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment