action-store 0.2.1 → 0.2.2
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 +4 -4
- data/{CHANGELOG → CHANGELOG.md} +9 -0
- data/lib/action_store/mixin.rb +7 -4
- data/lib/action_store/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1b80762a43d47ccf77400612e0ec4840e1ab5f1
|
4
|
+
data.tar.gz: 3cb456ca8cfc16739c8fbb3cb1a1feb81691e5cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7de4c8111d3b7b92a14be4e041f079edce3dd011a81bcf2305f2c6fda7bf6ed8eeb8ad1173d25776a400458fbc9fdf1898ea7ed46b6bd8330cc0dcf673f78692
|
7
|
+
data.tar.gz: 34686b4ceea1480b6aba7708be7e0ebd6a0dd26680edf79d7b4c85883c990826584d8b2a28eb44255f83b093d8d89e747e3eec6cad81ee8129dcd2c11810c960
|
data/{CHANGELOG → CHANGELOG.md}
RENAMED
data/lib/action_store/mixin.rb
CHANGED
@@ -23,10 +23,12 @@ module ActionStore
|
|
23
23
|
module ClassMethods
|
24
24
|
attr_reader :defined_actions
|
25
25
|
|
26
|
-
def find_defined_action(action_type,
|
26
|
+
def find_defined_action(action_type, target_type)
|
27
27
|
action_type = action_type.to_s
|
28
|
-
name =
|
29
|
-
defined_actions.find
|
28
|
+
name = target_type.to_s.singularize.underscore
|
29
|
+
defined_actions.find do |a|
|
30
|
+
a[:action_type] == action_type && (a[:action_name] == name || a[:target_type] == target_type)
|
31
|
+
end
|
30
32
|
end
|
31
33
|
|
32
34
|
def action_store(action_type, name, opts = {})
|
@@ -48,6 +50,7 @@ module ActionStore
|
|
48
50
|
action_name: name.to_s,
|
49
51
|
action_type: action_type,
|
50
52
|
target_klass: target_klass,
|
53
|
+
target_type: klass_name,
|
51
54
|
counter_cache: opts[:counter_cache],
|
52
55
|
user_counter_cache: opts[:user_counter_cache]
|
53
56
|
}
|
@@ -212,4 +215,4 @@ module ActionStore
|
|
212
215
|
end
|
213
216
|
end
|
214
217
|
end
|
215
|
-
end
|
218
|
+
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.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Lee
|
@@ -37,7 +37,7 @@ executables: []
|
|
37
37
|
extensions: []
|
38
38
|
extra_rdoc_files: []
|
39
39
|
files:
|
40
|
-
- CHANGELOG
|
40
|
+
- CHANGELOG.md
|
41
41
|
- LICENSE
|
42
42
|
- README.md
|
43
43
|
- Rakefile
|
@@ -71,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
71
|
version: '0'
|
72
72
|
requirements: []
|
73
73
|
rubyforge_project:
|
74
|
-
rubygems_version: 2.
|
74
|
+
rubygems_version: 2.6.8
|
75
75
|
signing_key:
|
76
76
|
specification_version: 4
|
77
77
|
summary: Store difference kind of actions (Like, Follow, Star, Block ...) in one table.
|