safeguard on absolutify rake task
This commit is contained in:
parent
7f87825186
commit
7477a22421
1 changed files with 16 additions and 14 deletions
|
|
@ -39,6 +39,7 @@ namespace :migrations do
|
||||||
require File.join(Rails.root,"config/environment")
|
require File.join(Rails.root,"config/environment")
|
||||||
|
|
||||||
Photo.all.each do |photo|
|
Photo.all.each do |photo|
|
||||||
|
unless photo.remote_photo_path
|
||||||
# extract root
|
# extract root
|
||||||
pod_url = photo.person.url
|
pod_url = photo.person.url
|
||||||
pod_url.chop! if pod_url[-1,1] == '/'
|
pod_url.chop! if pod_url[-1,1] == '/'
|
||||||
|
|
@ -57,4 +58,5 @@ namespace :migrations do
|
||||||
photo.save!
|
photo.save!
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue