Skip to content

Instantly share code, notes, and snippets.

@erskingardner
Created May 26, 2011 09:31
Show Gist options
  • Save erskingardner/992836 to your computer and use it in GitHub Desktop.
Save erskingardner/992836 to your computer and use it in GitHub Desktop.
Adding ActiveRecord-style callbacks to ActiveResource models
# 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