Skip to content

Instantly share code, notes, and snippets.

@thoughtbot
Created August 4, 2009 22:27
Show Gist options
  • Select an option

  • Save thoughtbot/162319 to your computer and use it in GitHub Desktop.

Select an option

Save thoughtbot/162319 to your computer and use it in GitHub Desktop.
class Article < ActiveRecord::Base
after_create :submit_to_crossref
private
def submit_to_crossref
CrossrefRequest.new(:title => title,
# other info for the request
:author => author).submit
end
end
class CrossrefRequest
def initialize(attributes)
# set attributes
end
def submit
# call helpers to format and submit the request
end
private
# helper methods related to formatting/submission
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment