flyer 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/flyer/controller_additions.rb +5 -7
- data/lib/flyer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3c6be37a754de57e7de456243de89e5b30e8159
|
4
|
+
data.tar.gz: 877d95f47b43563d38aa76d726097d3875cea4af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e36b822ecb35b83ab43e30ce782f6c11d3bbb39923d001233306477d626047098ebc0ed3051d574e73efe00c336b94567a78810665446133e7aac4a08fbe69ae
|
7
|
+
data.tar.gz: 2332f60800af1e4f9bf63f1f55bfe50960716920e3cc781d8597cc9705a63ad805e112c2f6df6cf5dd2c95cb8fa1659513311956229cc203d71c2ea4cf0fea19
|
@@ -4,12 +4,15 @@ module Flyer::ControllerAdditions
|
|
4
4
|
#
|
5
5
|
def notifications
|
6
6
|
@notifications ||= begin
|
7
|
+
limit = Flyer.settings.max_notifications ||
|
8
|
+
Flyer::Notification.notifications.count
|
9
|
+
|
7
10
|
found_notifications = []
|
8
|
-
Flyer::Notification.notifications.
|
11
|
+
Flyer::Notification.notifications.each_with_index do |n, index|
|
9
12
|
notification = Flyer::Notification.new(self)
|
10
13
|
n.call(notification)
|
11
14
|
notification.validate!
|
12
|
-
if notification.visible?
|
15
|
+
if notification.visible? and index < limit
|
13
16
|
notification.used!
|
14
17
|
found_notifications << notification.view
|
15
18
|
end
|
@@ -20,11 +23,6 @@ module Flyer::ControllerAdditions
|
|
20
23
|
raise Flyer::FoundNonUniqueIds.new
|
21
24
|
end
|
22
25
|
|
23
|
-
#
|
24
|
-
if limit = Flyer.settings.max_notifications
|
25
|
-
found_notifications = found_notifications.take(limit)
|
26
|
-
end
|
27
|
-
|
28
26
|
found_notifications
|
29
27
|
end
|
30
28
|
end
|
data/lib/flyer/version.rb
CHANGED