Checking for failing to set url in photo
This commit is contained in:
parent
b279d6582b
commit
4019e4425a
2 changed files with 3 additions and 2 deletions
|
|
@ -17,7 +17,7 @@ module AlbumsHelper
|
|||
|
||||
def album_person(album)
|
||||
person = album.person
|
||||
if album.person_id == current_user.id
|
||||
if album.person_id == current_user.person.id
|
||||
link_to "you", user_path(current_user)
|
||||
else
|
||||
link_to person.real_name, person_path(person)
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@ class Photo < Post
|
|||
name_start = remote_path.rindex '/'
|
||||
@remote_photo_path = remote_path.slice(0, name_start )
|
||||
@remote_photo_name = remote_path.slice(name_start, remote_path.length)
|
||||
puts url
|
||||
save
|
||||
raise "Failed to set path for : #{self.inspect}" if Photo.first(:id => self.id).url.nil?
|
||||
end
|
||||
|
||||
def url name = nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue