Commit 4efdb171fd602e28beb550c2c747ad9ce584423b
1 parent
4ee2d32b
Exists in
master
fixed cache_store and logger config when config is nil
Showing
2 changed files
with
6 additions
and
2 deletions
Show diff stats
lib/qy_wechat_api.rb
... | ... | @@ -52,7 +52,7 @@ module QyWechatApi |
52 | 52 | end |
53 | 53 | |
54 | 54 | def cache |
55 | - if config.cache_store | |
55 | + if config.try(:cache_store) | |
56 | 56 | config.cache_store |
57 | 57 | elsif on_rails? |
58 | 58 | Rails.cache |
... | ... | @@ -62,7 +62,7 @@ module QyWechatApi |
62 | 62 | end |
63 | 63 | |
64 | 64 | def logger |
65 | - if config.logger | |
65 | + if config.try(:logger) | |
66 | 66 | config.logger |
67 | 67 | elsif on_rails? |
68 | 68 | Rails.logger | ... | ... |
lib/qy_wechat_api/storage/storage.rb