mongoid-forums 0.0.9 → 0.0.10

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9bdf3c71e24211880b870d5f17158a1dbfd49005
4
- data.tar.gz: 75379a0a853b6ef2db67c24e25e77dc42fb872ad
3
+ metadata.gz: 48f9fb44106dc7ee9893700c82ab559aaba41743
4
+ data.tar.gz: 586a546b29ec037aebfa8f3e155fcdf5562a94e0
5
5
  SHA512:
6
- metadata.gz: 40ef04419c68fd0bcba32664e6a908bd3110a86e25d3d74be920e75d2cf5d6411fc948b93e292753bb6f0e7dbd518f90a4bfcf7d516ed08f6512f7ed880d2374
7
- data.tar.gz: 2f48f9a3800cd093463a8d8cd42ac97e3ab40a72dab696070d5e060e47b8d2fb0afbd568137f0354621e642d4b744455dff863c9d8e5d7e460b6a785ae8cbf13
6
+ metadata.gz: 576b1c9963613a475f9d982e784578c297abf08ca9b7411e1fc90f5a18cf086319a43581e039761f05aaead4e1a80518776aa299a93ca977c85e2736366f09c6
7
+ data.tar.gz: aab0c333471cac834a7e5575d33e4eca12e289912db59d74d2e745d6944cbac765be04228c9886d4773b34f0bd379c3442dafa5246b45dea56aac1a2bd12486d
@@ -12,7 +12,7 @@ module MongoidForums
12
12
  @posts = @posts.page(params[:page]).per(MongoidForums.per_page)
13
13
 
14
14
  if mongoid_forums_user.present?
15
- Alert.where(:user_id => mongoid_forums_user.id).update_all(:read => true)
15
+ Alert.where(user_id: mongoid_forums_user.id, read: false, subscription_id: Subscription.where(subscribable_id: @topic.id, subscriber_id: mongoid_forums_user.id).first).update_all(:read => true, :ready_at => Time.now)
16
16
  end
17
17
  end
18
18
  end
@@ -64,16 +64,16 @@ module MongoidForums
64
64
  def text
65
65
  str = ""
66
66
  case self.subscription.subscribable_type
67
- when "MongoidForums::Topic"
68
- str += self.mongoid_forums_topic_replier
69
- if self.mongoid_forums_topic_count > 0
70
- str += " and " + self.mongoid_forums_topic_count.to_s + " other" + (self.mongoid_forums_topic_count > 1 ? "s" : "")
67
+ when "MongoidForums::Topic"
68
+ str += self.mongoid_forums_topic_replier
69
+ if self.mongoid_forums_topic_count > 0
70
+ str += " and " + self.mongoid_forums_topic_count.to_s + " other" + (self.mongoid_forums_topic_count > 1 ? "s" : "")
71
+ end
72
+ str += " replied to " + self.subscription.subscribable.name
73
+ else
74
+ str
71
75
  end
72
- str += " replied to " + self.subscription.subscribable.subject
73
- else
74
- str
75
- end
76
- str += " " + time_ago_in_words(self.updated_at, false, :vague => true) + " ago"
76
+ return str
77
77
  end
78
78
  end
79
79
 
@@ -1,3 +1,3 @@
1
1
  module MongoidForums
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-forums
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - skipperguy12
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-05 00:00:00.000000000 Z
11
+ date: 2015-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails