Stream 0.1.13 → 0.1.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/stream/fires.rb +6 -5
  2. data/stream.gemspec +1 -1
  3. metadata +1 -1
data/lib/stream/fires.rb CHANGED
@@ -42,9 +42,10 @@ module Stream
42
42
  gallery = activity.subject.gallery
43
43
  photo = activity.subject
44
44
  # Find recent photo activity
45
- last_activity = ActivityItem.find(:first, :conditions => ["subject_type = ? AND subject_id = ? AND DATE(updated_at) = current_date",
46
- photo.class,photo.id])
47
-
45
+ last_activity = ActivityItem.find(:first,
46
+ :conditions => ["subject_type = ? AND photos.gallery_id = ? AND DATE(activity_items.updated_at) = current_date",
47
+ self.class,gallery_id],:include=>[:photos])
48
+
48
49
  unless last_activity && (gallery.eql?(last_activity.subject.gallery))
49
50
  ([activity.actor] + gallery.allowed_contacts).each do |p|
50
51
  activity.is_hidden = activity.subject.approval_status==true ? true : false
@@ -54,8 +55,8 @@ module Stream
54
55
  send(:"after_#{opts[:on]}", method_name, :if => opts[:if])
55
56
  end
56
57
  else
57
- last_activity.photos << activity.subject
58
- last_activity.save
58
+ last_activity.photos << self
59
+ last_activity.update_attribute(:updated_at,Time.now)
59
60
  end
60
61
  else
61
62
  activity.save
data/stream.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{Stream}
5
- s.version = "0.1.13"
5
+ s.version = "0.1.14"
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"]
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.13
4
+ version: 0.1.14
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: