Skip to content

Instantly share code, notes, and snippets.

@brandon-beacher
Created February 4, 2009 15:26
Show Gist options
  • Save brandon-beacher/58143 to your computer and use it in GitHub Desktop.
Save brandon-beacher/58143 to your computer and use it in GitHub Desktop.
class AmazonSimplePayTransaction < ActiveRecord::Base
after_create :pay_amazon_simple_payable
belongs_to :amazon_simple_payable, :polymorphic => true
private
def pay_amazon_simple_payable
amazon_simple_payable.update_attributes! :paid => true if %w{PI PS}.include?(status)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment