action-store 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e856a3c707a03c3b16ad3e5ab629ce80741c8a2ba929e70cec2b2b84c75187c9
4
- data.tar.gz: df3ccb912b970c2e3b8512720382d09551880abb9f7b0c8e48c57e1b0d421318
3
+ metadata.gz: 12f4da4ba15b80ce1d6b39c4efab7d3f33b9d96ff76fbabfad626968eb3361a3
4
+ data.tar.gz: 0213e0fe4e342febfe30a99cc145bfb8ce0fbc3054eb64f4d4d66bf1dff1c9bb
5
5
  SHA512:
6
- metadata.gz: bc193bc4b1a8f8a56b7a8c5ea4eee112e0a794e4b300d9abff91d3409f58976bea1312b84ba988c4a74e8e69934c312c3e0f648101738ac754f9d7a76998e4e5
7
- data.tar.gz: 76daff55736babee4d1d58a80eeb28d624a585832b7e52f84f05235a30cc42c78a3290c241559486731ffce82e066b267d00d03e1109f0f14a1a1555d81b73c6
6
+ metadata.gz: 722c7ec00870ab9277162217a2f4aff924e93dbe97d077e6ce2b9e1f01d6b819e2f747807acca5a27afa7a4d06a4e28fdfb253fb30385507a7b63faa8a729ced
7
+ data.tar.gz: 7045e584f4806ad23a7bff274bfc673bd3cf84a5fc53178c872980e6344722d142788a0a9da34a00d612ab240eb4b1b3d392e2c0630390c5c93327de09f489a2
@@ -1,3 +1,19 @@
1
+ 0.4.3
2
+ -----
3
+
4
+ - Auto reload `target`, when action/unaction target.
5
+
6
+ ```rb
7
+ irb> post.likes_count
8
+ => 0
9
+ irb> user.like_post(post)
10
+ irb> post.likes_count
11
+ => 1
12
+ irb> user.unlike_post(post)
13
+ irb> post.likes_count
14
+ => 0
15
+ ```
16
+
1
17
  0.4.2
2
18
  -----
3
19
 
@@ -191,6 +191,7 @@ module ActionStore
191
191
  result = user_klass.create_action(action_type, target_type: target_klass.name,
192
192
  target_id: target_id,
193
193
  user: self)
194
+ target_or_id.reload if target_or_id.is_a?(target_klass)
194
195
  self.reload
195
196
  result
196
197
  end
@@ -210,6 +211,7 @@ module ActionStore
210
211
  result = user_klass.destroy_action(action_type, target_type: target_klass.name,
211
212
  target_id: target_id,
212
213
  user: self)
214
+ target_or_id.reload if target_or_id.is_a?(target_klass)
213
215
  self.reload
214
216
  result
215
217
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ActionStore
3
- VERSION = "0.4.2"
3
+ VERSION = "0.4.3"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action-store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Lee
@@ -121,8 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  - !ruby/object:Gem::Version
122
122
  version: '0'
123
123
  requirements: []
124
- rubyforge_project:
125
- rubygems_version: 2.7.8
124
+ rubygems_version: 3.0.1
126
125
  signing_key:
127
126
  specification_version: 4
128
127
  summary: Store difference kind of actions (Like, Follow, Star, Block ...) in one table.