Stream 0.1.20 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/lib/stream/fires.rb +17 -0
  2. data/stream.gemspec +2 -2
  3. metadata +2 -2
data/lib/stream/fires.rb CHANGED
@@ -37,6 +37,23 @@ module Stream
37
37
 
38
38
  if activity_type.to_s.eql?'new_message'
39
39
  activity.subject.recipient.activity_items << activity
40
+ elsif activity_type.to_s.eql?'new_photo'
41
+ last_activity = ActivityItem.find(:first,
42
+ :conditions => ["subject_type = ? AND photos.gallery_id = ? AND DATE(activity_items.updated_at) = current_date",
43
+ activity.subject.class,activity.subject.gallery_id],:include=>[:photos])
44
+
45
+ if last_activity && (activity.subject.gallery.eql?(last_activity.subject.gallery))
46
+ last_activity.photos << activity.subject
47
+ last_activity.update_attribute(:updated_at,Time.now)
48
+ activity.destroy
49
+ else
50
+ ([activity.actor] + activity.subject.gallery.allowed_contacts).each do |p|
51
+ activity.is_hidden = activity.subject.approval_status ? false : true
52
+ activity.photos << activity.subject
53
+ activity.save
54
+ p.activity_items << activity
55
+ end
56
+ end
40
57
  else
41
58
  ([activity.actor] + activity.actor.contacts).each{|p| p.activity_items << activity }
42
59
  end
data/stream.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{Stream}
5
- s.version = "0.1.20"
5
+ s.version = "0.1.21"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Gretchen Gapol"]
9
- s.date = %q{2011-06-27}
9
+ s.date = %q{2011-07-01}
10
10
  s.description = %q{news feed based on timeline with some modifications}
11
11
  s.email = %q{ggapol@exist.com}
12
12
  s.extra_rdoc_files = []
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Stream
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.20
4
+ version: 0.1.21
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-06-27 00:00:00.000000000 +08:00
12
+ date: 2011-07-01 00:00:00.000000000 +08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
  description: news feed based on timeline with some modifications