diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index e3a90658a..b21ff49f1 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -128,7 +128,7 @@ class PhotosController < ApplicationController format.html do flash[:notice] = I18n.t 'photos.destroy.notice' if photo.status_message_guid - if photo.status_message.message_or_photos_present? + if photo.status_message.text_and_photos_blank? photo.status_message.destroy respond_with photo, :location => person_photos_path(current_user.person) else diff --git a/app/models/status_message.rb b/app/models/status_message.rb index eb2b4c577..fa3a8e241 100644 --- a/app/models/status_message.rb +++ b/app/models/status_message.rb @@ -136,14 +136,14 @@ class StatusMessage < Post formatted_message(:plain_text => true) end - def message_or_photos_present? + def text_and_photos_blank? self.text.blank? && self.photos == [] end protected def ensure_message_requirements - if message_or_photos_present? + if text_and_photos_blank? errors[:base] << 'Status message requires a message or at least one photo' end end