Skip to content

Instantly share code, notes, and snippets.

@garybernhardt
Created April 17, 2011 22:49
Show Gist options
  • Save garybernhardt/924561 to your computer and use it in GitHub Desktop.
Save garybernhardt/924561 to your computer and use it in GitHub Desktop.
# I do this:
module ActiveRecord
class Base
@@old_save = instance_method(:save)
def save *args
@@old_save.bind(self).call *args
end
end
end
# Then, when saving a model, I get this:
#
# Failure/Error: bob.transactions << Transaction.new
# NoMethodError:
# super: no superclass method `save' for #<Transaction:0x10a331d40>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment