Created
October 9, 2009 09:26
-
-
Save airblade/205881 to your computer and use it in GitHub Desktop.
This file contains 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
# PaperTrail's version class (existing code omitted for clarity). | |
class Version < ActiveRecord::Base | |
before_update :before_update_hook | |
after_update :after_update_hook | |
def before_update_hook | |
end | |
def after_update_hook | |
end | |
end | |
# In a client Rails app, re-open version class to implement hooks. | |
class Version < ActiveRecord::Base | |
def before_update_hook | |
self.phase_of_moon = MoonWebService.get_phase | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment