Skip to content

Instantly share code, notes, and snippets.

@maciej
Created March 4, 2009 19:13
Show Gist options
  • Save maciej/73951 to your computer and use it in GitHub Desktop.
Save maciej/73951 to your computer and use it in GitHub Desktop.
class Picture < ActiveRecord::Base
def self.new_from_flickr_photo(photo)
picture = Picture.new
picture.set_attributes_from_flickr_photo(photo)
picture
end
def set_attributes_from_flickr_photo(photo)
# copy whichever attributes you might need
end
def flickr_photo(flickr)
# re-create the photo-object
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment