Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxwell Salzberg <maxwell@joindiaspora.com>2011-11-05 06:56:53 +0400
committerMaxwell Salzberg <maxwell@joindiaspora.com>2011-11-05 06:56:53 +0400
commitf85a047f6f61b71eb8f40a594e4f26eeff41b297 (patch)
treed7a34b2f1f9286a99e153f2fcecda9507d6d6143
parentcde12ec2325308c631cd2b2f0a6549e5519bbdf0 (diff)
MS DG; for real this time?
-rw-r--r--lib/diaspora/shareable.rb2
-rw-r--r--spec/models/post_spec.rb7
2 files changed, 2 insertions, 7 deletions
diff --git a/lib/diaspora/shareable.rb b/lib/diaspora/shareable.rb
index d6e13dee9..85cea06f2 100644
--- a/lib/diaspora/shareable.rb
+++ b/lib/diaspora/shareable.rb
@@ -111,7 +111,7 @@ module Diaspora
def participants
@participants ||= lambda do
share_type = self.class.base_class.to_s
- people = [self.author]
+ people = []
if self.respond_to? :comments
people += Person.joins(:comments).where(:comments => {:commentable_id => self.id, :commentable_type => share_type}).all
end
diff --git a/spec/models/post_spec.rb b/spec/models/post_spec.rb
index ddf5dda54..87106d706 100644
--- a/spec/models/post_spec.rb
+++ b/spec/models/post_spec.rb
@@ -196,17 +196,12 @@ describe Post do
end
describe '#participants' do
- it 'includes the post author' do
- status = Factory(:status_message, :author => bob.person, :public => true)
- status.participants.map(&:id).should == [bob.person.id]
- end
-
it 'only returns the people that commented and liked the post' do
status = Factory(:status_message, :author => bob.person, :public => true)
alice.comment('too', :post => status)
eve.like(true, :target => status)
- status.participants.map(&:id).should =~ [alice, eve, bob].map{|x| x.person.id}
+ status.participants.map(&:id).should =~ [alice, eve].map{|x| x.person.id}
end
end