Skip to content

Instantly share code, notes, and snippets.

@knewter
Created February 28, 2012 17:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save knewter/1933864 to your computer and use it in GitHub Desktop.
Save knewter/1933864 to your computer and use it in GitHub Desktop.
# First, set up a customer_create method.  This tells us how to create the
# customer in your persistence layer.
IsotopeSubscriptions.customer_create = lambda do |hash|
  customer = Customer.new(hash)
  if customer.save
    customer
  else
    false
  end
end

# Next, set up a customer_find method.  This tells us how to find the
# customer in your persistence layer.
IsotopeSubscriptions.customer_find = lambda do |id|
  Customer.find params[:id]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment