Change some person_ids to author_ids

This commit is contained in:
Raphael Sofaer 2011-03-09 15:28:27 -08:00
parent e38a136c49
commit 5cc7aa4496
4 changed files with 8 additions and 8 deletions

View file

@ -5,10 +5,10 @@ module PhotoMover
FileUtils::mkdir_p temp_dir
Dir.chdir 'tmp/exports'
photos = user.visible_posts(:person_id => user.person.id, :type => 'Photo')
photos = user.visible_posts(:author_id => user.person.id, :type => 'Photo')
photos_dir = "#{user.id}/photos"
FileUtils::mkdir_p photos_dir
FileUtils::mkdir_p photos_dir
photos.each do |photo|
current_photo_location = "#{Rails.root}/public/uploads/images/#{photo.image_filename}"

View file

@ -61,7 +61,7 @@ module Diaspora
end
def create_body
@user.visible_posts(:person_id => @user.person.id, :public=>true).inject("") do |xml,curr|
@user.visible_posts(:author_id => @user.person.id, :public=>true).inject("") do |xml,curr|
if curr.respond_to?(:to_activity)
unless xml
curr.to_activity

View file

@ -39,8 +39,8 @@ class PostsFake
@model.id.to_s
end
def person
@fakes_collection.people_hash[@model.person_id]
def author
@fakes_collection.people_hash[@model.author_id]
end
def method_missing(method, *args)

View file

@ -36,10 +36,10 @@ describe PostsFake do
@fakes = mock()
@fake = PostsFake::Fake.new(@post, @fakes)
end
it 'refers to the parent collection for a person' do
@post.should_receive(:person_id)
it 'refers to the parent collection for an author' do
@post.should_receive(:author_id)
@fakes.should_receive(:people_hash).and_return({})
@fake.person
@fake.author
end
it 'refers to its comments array for comments' do
@fake.comments = [mock()]