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 FileUtils::mkdir_p temp_dir
Dir.chdir 'tmp/exports' 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" photos_dir = "#{user.id}/photos"
FileUtils::mkdir_p photos_dir FileUtils::mkdir_p photos_dir
photos.each do |photo| photos.each do |photo|
current_photo_location = "#{Rails.root}/public/uploads/images/#{photo.image_filename}" current_photo_location = "#{Rails.root}/public/uploads/images/#{photo.image_filename}"

View file

@ -61,7 +61,7 @@ module Diaspora
end end
def create_body 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) if curr.respond_to?(:to_activity)
unless xml unless xml
curr.to_activity curr.to_activity

View file

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

View file

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