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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d6832c4cb6bd12af77ec2e917a511ff8e1e321ef075fea55d3fda293d215086d
4
- data.tar.gz: 031e5cd22170d331739f92304ee740804703cb692839c92b8ddea8dc7aded424
3
+ metadata.gz: 1032443316f9af5efc5d9d858fc72977e246c3dc04bf411818b6313cd9eb274a
4
+ data.tar.gz: a079f1d09677c56750b2c9b0a9f438505a60d4727cfa9bc1e036b6ef94783dcc
5
5
  SHA512:
6
- metadata.gz: 31cc72ec145aadaa3aaa34be3d650387b35c905799b5bf19d38a0effed21db7e51dec651c12e252ea87670a17b6f5439e26cbbacb1b8887dca043dc0eb7602da
7
- data.tar.gz: 7dafaa4a7431c3216234a2de4551f749874ffb2aaf8f25ec0002e544828002581a74f648fdc8139bb6406eb8fde28a8694600364050de9b0c38b1ad22795a306
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 user.present?
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.
@@ -1,3 +1,3 @@
1
1
  module Dokno
2
- VERSION = '1.2.0'
2
+ VERSION = '1.2.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dokno
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Courtney Payne