notification-renderer 1.0.0.beta8 → 1.0.0.beta9
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5a96491db46d1de11191d4da18b486a6773580706581d64298e37a2c9752840
|
4
|
+
data.tar.gz: 904e108702fb02cf6bea2e04b7e588421b1c61df9b68e351b48717d1b2c016b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69b7fdc5a0c8ca5ecd27221fb274389073e58dda00dffdae86bc5b11c589532c5ff61c28110d13657dd390f874496c790edd3889fc61453664786d7f2ffd1ab8
|
7
|
+
data.tar.gz: f6acb92f8aca244c056d2fd303991e8adbb34fd65067ff9c370edc2e0ef0a1a5b1cb762d58fd528940f817681d6b0f4e89113f7111fd333eda956eaa16b4cd9f
|
@@ -1,12 +1,22 @@
|
|
1
1
|
module NotificationRenderer
|
2
2
|
module NotificationLibrary
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
included do
|
7
|
+
include NotificationRenderer::NotificationLibrary::InstanceMethods
|
6
8
|
end
|
7
9
|
|
8
|
-
|
9
|
-
|
10
|
+
module InstanceMethods
|
11
|
+
|
12
|
+
def self.grouping group_by
|
13
|
+
group_by{ |notification| notification.send(group_by) }
|
14
|
+
end
|
15
|
+
|
16
|
+
def type
|
17
|
+
self[:type] || NotificationRenderer.configuration.default_type
|
18
|
+
end
|
19
|
+
|
10
20
|
end
|
11
21
|
|
12
22
|
end
|
@@ -1,17 +1,27 @@
|
|
1
1
|
module NotificationRenderer
|
2
2
|
module NotificationScopes
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
super
|
9
|
-
end
|
3
|
+
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
included do
|
7
|
+
include NotificationRenderer::NotificationScopes::InstanceMethods
|
10
8
|
end
|
11
9
|
|
12
|
-
|
13
|
-
|
10
|
+
module InstanceMethods
|
11
|
+
|
12
|
+
def method_missing m, *args
|
13
|
+
if m.to_s[/(.+)_type/]
|
14
|
+
where type: $1.singularize.classify
|
15
|
+
else
|
16
|
+
super
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def respond_to? m, include_private = false
|
21
|
+
super || m.to_s[/(.+)_type/]
|
22
|
+
end
|
23
|
+
|
14
24
|
end
|
15
|
-
|
25
|
+
|
16
26
|
end
|
17
27
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: notification-renderer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.beta9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Hübotter
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.0.0.
|
47
|
+
version: 1.0.0.beta9
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.0.0.
|
54
|
+
version: 1.0.0.beta9
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|