Permalink
Browse files

Simplify the photo sync a little.

  • Loading branch information...
1 parent 5bda11e commit c2f4902899c0951c3f4e3246ff33dc0b424698d5 @timriley committed Jan 1, 2009
Showing with 2 additions and 5 deletions.
  1. +2 −5 app/models/photo.rb
View
@@ -90,11 +90,8 @@ def self.sync_with_flickr(options = {})
flickr_photos.each do |flickr_photo|
if local_photo = local_photos_by_flickr_id[flickr_photo.id]
# we've imported the photo before, update it from flickr if it is stale
- if local_photo.flickr_updated_at.to_i < flickr_photo.flickr_updated_at.to_i
- local_photo.update_from_flickr
- # local_photo.attributes.merge(flickr_photo.attributes)
- local_photo.save
- end
+ local_photo.update_from_flickr_photo(flickr_photo)
+ local_photo.save if local_photo.changed?
else
# if the photo does not exist locally, create it.
Photo.create_from_flickr_photo(flickr_photo)

0 comments on commit c2f4902

Please sign in to comment.