From 5cc7aa44963af78614e1014e6bcc27cac9c851c1 Mon Sep 17 00:00:00 2001
From: Raphael Sofaer <raphael@joindiaspora.com>
Date: Wed, 9 Mar 2011 15:28:27 -0800
Subject: [PATCH] Change some person_ids to author_ids

---
 lib/collect_user_photos.rb      | 4 ++--
 lib/diaspora/ostatus_builder.rb | 2 +-
 lib/fake.rb                     | 4 ++--
 spec/lib/fake_spec.rb           | 6 +++---
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/collect_user_photos.rb b/lib/collect_user_photos.rb
index 9e4c5befd8..cd9d3d6e8b 100644
--- a/lib/collect_user_photos.rb
+++ b/lib/collect_user_photos.rb
@@ -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}"
diff --git a/lib/diaspora/ostatus_builder.rb b/lib/diaspora/ostatus_builder.rb
index 6947cf901e..fad33df444 100644
--- a/lib/diaspora/ostatus_builder.rb
+++ b/lib/diaspora/ostatus_builder.rb
@@ -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
diff --git a/lib/fake.rb b/lib/fake.rb
index 0996883157..fe51a8f4c7 100644
--- a/lib/fake.rb
+++ b/lib/fake.rb
@@ -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)
diff --git a/spec/lib/fake_spec.rb b/spec/lib/fake_spec.rb
index 0cf749568b..7e6cb5aead 100644
--- a/spec/lib/fake_spec.rb
+++ b/spec/lib/fake_spec.rb
@@ -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()]
-- 
GitLab