Created
May 26, 2011 09:31
-
-
Save erskingardner/992836 to your computer and use it in GitHub Desktop.
Adding ActiveRecord-style callbacks to ActiveResource models
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
# app/models/my_class.rb | |
class MyClass < ActiveResource::Base | |
extend ActiveModel::Callbacks | |
define_model_callbacks :save | |
before_save :my_method | |
def my_method | |
# work your magic here. | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment