photon 0.1.0 → 0.1.1

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.
@@ -22,6 +22,7 @@ module Photon
22
22
  )
23
23
 
24
24
  message.deliveries.update_all({:message_thread_id => opts[:message_thread_id], :scope_id => opts[:scope_id], :scope_type => opts[:scope_type]})
25
+ return message
25
26
  end
26
27
  end
27
28
 
@@ -56,6 +57,11 @@ module Photon
56
57
  end
57
58
  end
58
59
 
60
+ def unread_count
61
+ through_string = Photon.through.to_s
62
+ constantize_model(Photon.using).where("#{through_string}.#{self.class.to_s.downcase}_id = ? AND #{through_string}.read IS NOT ?", self.id, true).joins(Photon.through).count
63
+ end
64
+
59
65
 
60
66
  private
61
67
  def change_read_status(message, status)
@@ -1,3 +1,3 @@
1
1
  module Photon
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: photon
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gerred Dillon
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-29 00:00:00 -07:00
18
+ date: 2011-01-30 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies: []
21
21