mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-24 07:48:26 -04:00
Don't update flickr photos in migration
This commit is contained in:
1 parent
9cdf2e899f
commit
83bba916a4
1 file changed
+1
-16
@@ -1,20 +1,5 @@
|
||||
class AddDatetakenToPhotos < ActiveRecord::Migration
|
||||
def up
|
||||
def change
|
||||
add_column :photos, :date_taken, :datetime
|
||||
update_flickr_metadata
|
||||
end
|
||||
|
||||
def down
|
||||
add_column :photos, :date_taken
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def update_flickr_metadata
|
||||
# Fetch from flickr, the photos updated the longest ago will be fetched first
|
||||
Photo.all.order(:updated_at).each do |photo|
|
||||
say "Fetch flickr data for #{photo}"
|
||||
photo.set_flickr_metadata!
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user