fix validation and order of status message sent
This commit is contained in:
parent
9b7d2ed0f6
commit
ea7bdfde28
4 changed files with 11 additions and 6 deletions
|
|
@ -16,15 +16,16 @@ class StatusMessagesController < ApplicationController
|
|||
params[:status_message][:public] = public_flag
|
||||
@status_message = current_user.build_post(:status_message, params[:status_message])
|
||||
|
||||
|
||||
if @status_message.save(:safe => true)
|
||||
raise 'MongoMapper failed to catch a failed save' unless @status_message.id
|
||||
|
||||
current_user.dispatch_post(@status_message, :to => params[:status_message][:to])
|
||||
|
||||
@status_message.photos += photos unless photos.nil?
|
||||
for photo in photos
|
||||
current_user.dispatch_post(photo, :to => params[:status_message][:to])
|
||||
end
|
||||
|
||||
current_user.dispatch_post(@status_message, :to => params[:status_message][:to])
|
||||
end
|
||||
|
||||
render :nothing => true
|
||||
|
|
|
|||
|
|
@ -25,9 +25,13 @@ class Photo < Post
|
|||
|
||||
before_destroy :ensure_user_picture
|
||||
|
||||
|
||||
def ownership_of_status_message
|
||||
if status_message_id
|
||||
self.diaspora_handle == StatusMessage.find_by_id(self.status_message_id).diaspora_handle
|
||||
message = StatusMessage.find_by_id(self.status_message_id)
|
||||
if status_message_id && message
|
||||
self.diaspora_handle == message.diaspora_handle
|
||||
else
|
||||
true
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
- if current_user
|
||||
= "#{current_user.real_name} | DIASPORA*"
|
||||
- else
|
||||
DIASPORA
|
||||
DIASPORA*
|
||||
|
||||
%meta{'http-equiv' => 'X-UA-Compatible', :content => 'IE=edge,chrome=1'}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ cross_server:
|
|||
deploy_to: '/usr/local/app/diaspora'
|
||||
user: 'root'
|
||||
repo: 'git://github.com/diaspora/diaspora.git'
|
||||
branch: 'master'
|
||||
branch: 'homepage'
|
||||
default_env: 'development'
|
||||
servers:
|
||||
tom:
|
||||
|
|
|
|||
Loading…
Reference in a new issue