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 +4 -4
- data/CHANGELOG.md +16 -0
- data/lib/action_store/mixin.rb +2 -0
- data/lib/action_store/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12f4da4ba15b80ce1d6b39c4efab7d3f33b9d96ff76fbabfad626968eb3361a3
|
4
|
+
data.tar.gz: 0213e0fe4e342febfe30a99cc145bfb8ce0fbc3054eb64f4d4d66bf1dff1c9bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 722c7ec00870ab9277162217a2f4aff924e93dbe97d077e6ce2b9e1f01d6b819e2f747807acca5a27afa7a4d06a4e28fdfb253fb30385507a7b63faa8a729ced
|
7
|
+
data.tar.gz: 7045e584f4806ad23a7bff274bfc673bd3cf84a5fc53178c872980e6344722d142788a0a9da34a00d612ab240eb4b1b3d392e2c0630390c5c93327de09f489a2
|
data/CHANGELOG.md
CHANGED
@@ -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
|
|
data/lib/action_store/mixin.rb
CHANGED
@@ -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
|
data/lib/action_store/version.rb
CHANGED
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.
|
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
|
-
|
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.
|