Users controller small fix; removed the to_activity method and the corresponding tests for status_message model
This commit is contained in:
parent
123e7ba3cb
commit
8178e0712c
3 changed files with 1 additions and 24 deletions
|
|
@ -105,7 +105,7 @@ class UsersController < ApplicationController
|
||||||
@posts = StatusMessage.where(:author_id => @user.person.id, :public => true).order('created_at DESC').limit(25)
|
@posts = StatusMessage.where(:author_id => @user.person.id, :public => true).order('created_at DESC').limit(25)
|
||||||
end
|
end
|
||||||
|
|
||||||
format.any { redirect_to person_path(user.person) }
|
format.any { redirect_to person_path(@user.person) }
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
redirect_to stream_path, :error => I18n.t('users.public.does_not_exist', :username => params[:username])
|
redirect_to stream_path, :error => I18n.t('users.public.does_not_exist', :username => params[:username])
|
||||||
|
|
|
||||||
|
|
@ -125,22 +125,6 @@ class StatusMessage < Post
|
||||||
identifiers.empty? ? [] : Person.where(:diaspora_handle => identifiers)
|
identifiers.empty? ? [] : Person.where(:diaspora_handle => identifiers)
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_activity(opts={})
|
|
||||||
author = opts[:author] || self.author #Use an already loaded author if passed in.
|
|
||||||
<<-XML
|
|
||||||
<entry>
|
|
||||||
<title>#{x(self.formatted_message(:plain_text => true))}</title>
|
|
||||||
<content>#{x(self.formatted_message(:plain_text => true))}</content>
|
|
||||||
<link rel="alternate" type="text/html" href="#{author.url}p/#{self.id}"/>
|
|
||||||
<id>#{author.url}p/#{self.id}</id>
|
|
||||||
<published>#{self.created_at.xmlschema}</published>
|
|
||||||
<updated>#{self.updated_at.xmlschema}</updated>
|
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
|
|
||||||
</entry>
|
|
||||||
XML
|
|
||||||
end
|
|
||||||
|
|
||||||
def after_dispatch(sender)
|
def after_dispatch(sender)
|
||||||
self.update_and_dispatch_attached_photos(sender)
|
self.update_and_dispatch_attached_photos(sender)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -287,13 +287,6 @@ STR
|
||||||
@marshalled.diaspora_handle.should == @message.diaspora_handle
|
@marshalled.diaspora_handle.should == @message.diaspora_handle
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
describe '#to_activity' do
|
|
||||||
it 'should render a string' do
|
|
||||||
@message.to_activity.should_not be_blank
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#after_dispatch' do
|
describe '#after_dispatch' do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue