diff options
author | danielgrippi <danielgrippi@gmail.com> | 2011-10-25 01:11:01 +0400 |
---|---|---|
committer | danielgrippi <danielgrippi@gmail.com> | 2011-10-25 01:41:15 +0400 |
commit | e63e8299b9d98d0cc013c719313458c58d511db8 (patch) | |
tree | ee43eead41d331bd95d7ec7e6f6f39936cd4700d /lib/stream/base.rb | |
parent | 59e495572784b8fce1c8a3b6d427915133213327 (diff) |
fixed up stream/publisher logic; fixed cukes
Diffstat (limited to 'lib/stream/base.rb')
-rw-r--r-- | lib/stream/base.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/stream/base.rb b/lib/stream/base.rb index c8044da57..a117ee996 100644 --- a/lib/stream/base.rb +++ b/lib/stream/base.rb @@ -1,12 +1,14 @@ require File.join(Rails.root, "lib", "publisher") class Stream::Base TYPES_OF_POST_IN_STREAM = ['StatusMessage', 'Reshare', 'ActivityStreams::Photo'] - attr_accessor :max_time, :order, :user + + attr_accessor :max_time, :order, :user, :publisher def initialize(user, opts={}) self.user = user self.max_time = opts[:max_time] self.order = opts[:order] + self.publisher = Publisher.new(self.user, publisher_opts) end # @return [Person] @@ -76,7 +78,6 @@ class Stream::Base true end - #NOTE: MBS bad bad methods the fact we need these means our views are foobared. please kill them and make them #private methods on the streams that need them def aspects @@ -87,7 +88,7 @@ class Stream::Base def aspect aspects.first end - + def aspect_ids aspects.map{|x| x.id} end @@ -102,12 +103,11 @@ class Stream::Base @order ||= 'created_at' end - # @return [Publisher] - def publisher - @publisher ||= Publisher.new(self.user) - end - private + # @return [Hash] + def publisher_opts + {} + end # Memoizes all Contacts present in the Stream # |