Created
November 29, 2015 19:11
-
-
Save mehlah/fa4eda72268451244723 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Record | |
def save | |
p 'saved!' | |
end | |
end | |
module Validation | |
def save | |
p 'validated!' | |
super | |
end | |
end | |
Record.send :prepend, Validation | |
Record.new.save | |
#=> "validated!" | |
#=> "saved!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment