dokno 1.2.0 → 1.2.1
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/app/controllers/dokno/user_concern.rb +5 -3
- data/app/models/dokno/category.rb +1 -1
- data/lib/dokno/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1032443316f9af5efc5d9d858fc72977e246c3dc04bf411818b6313cd9eb274a
|
|
4
|
+
data.tar.gz: a079f1d09677c56750b2c9b0a9f438505a60d4727cfa9bc1e036b6ef94783dcc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b58630386a83f001e2e3a49def7e14cb833de066724be74b44ca56b08494ff9a72994ea0c2e5f324b09832a2f8848921fd9fa1eb1a41e83f11e8aba166669438
|
|
7
|
+
data.tar.gz: 6f1cf01dcd513f4dc4ce57acc85ba7dcb42aaac06585431562bdf06c5f9c012e0ea8a0c7588974045ca1e14704e9d2630a68150c000a032e321bf0c70a61f0bd
|
|
@@ -8,8 +8,6 @@ module Dokno
|
|
|
8
8
|
|
|
9
9
|
def user
|
|
10
10
|
# Attempt to eval the currently signed in 'user' object from the host app
|
|
11
|
-
sanitized_user_obj_string = Dokno.config.app_user_object.to_s.split(/\b/).first
|
|
12
|
-
|
|
13
11
|
proc {
|
|
14
12
|
$safe = 1
|
|
15
13
|
eval sanitized_user_obj_string
|
|
@@ -19,13 +17,17 @@ module Dokno
|
|
|
19
17
|
nil
|
|
20
18
|
end
|
|
21
19
|
|
|
20
|
+
def sanitized_user_obj_string
|
|
21
|
+
Dokno.config.app_user_object.to_s.split(/\b/).first
|
|
22
|
+
end
|
|
23
|
+
|
|
22
24
|
def username
|
|
23
25
|
user&.send(Dokno.config.app_user_name_method.to_sym).to_s
|
|
24
26
|
end
|
|
25
27
|
|
|
26
28
|
def can_edit?
|
|
27
29
|
# Allow editing by default if host app user object is not configured
|
|
28
|
-
return true unless
|
|
30
|
+
return true unless sanitized_user_obj_string.present?
|
|
29
31
|
return false unless user.respond_to? Dokno.config.app_user_auth_method.to_sym
|
|
30
32
|
|
|
31
33
|
user.send(Dokno.config.app_user_auth_method.to_sym)
|
|
@@ -59,7 +59,7 @@ module Dokno
|
|
|
59
59
|
|
|
60
60
|
# Used to invalidate the fragment cache of the hierarchical category select options
|
|
61
61
|
def self.cache_key
|
|
62
|
-
[maximum(:updated_at), Article.maximum(:updated_at)].max
|
|
62
|
+
updated_timestamps = [maximum(:updated_at), Article.maximum(:updated_at)].compact.max
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
# The given Category and all child Categories. Useful for filtering associated articles.
|
data/lib/dokno/version.rb
CHANGED