tml 4.3.9 → 4.3.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tml/application.rb +7 -1
- data/lib/tml/session.rb +1 -19
- data/lib/tml/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: dd726ec4d8e669b5260eeef038dc0329e6806bd9
|
4
|
+
data.tar.gz: fbf200f5e07562a46cf3430f0b88776beef69d19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6af904753661a742074b7a0a0e8965029a259c4544d6c7dc7e92d1f916e99ca897672b3b311ec3216a4f6cfc38fabf9b94c27819540a019bf2068e6d270f5d38
|
7
|
+
data.tar.gz: c0cb5917de547073873dd50e78360c660face599c1ff19aeb6de362e44edd7c427d62f9580a0da5492795e9c47df32c24dc04eabbcb0dba4eb22e23612d437d0
|
data/lib/tml/application.rb
CHANGED
@@ -46,7 +46,13 @@ class Tml::Application < Tml::Base
|
|
46
46
|
|
47
47
|
def fetch
|
48
48
|
data = api_client.get('applications/current', {:definition => true}, {:cache_key => self.class.cache_key})
|
49
|
-
|
49
|
+
if data
|
50
|
+
update_attributes(data)
|
51
|
+
else
|
52
|
+
Tml.logger.debug('Cache enabled but no data is provided.')
|
53
|
+
end
|
54
|
+
|
55
|
+
self
|
50
56
|
rescue Tml::Exception => ex
|
51
57
|
Tml.logger.error("Failed to load application: #{ex}")
|
52
58
|
self
|
data/lib/tml/session.rb
CHANGED
@@ -37,18 +37,9 @@ module Tml
|
|
37
37
|
end
|
38
38
|
|
39
39
|
class Session
|
40
|
-
# Session Attributes - Move to Session
|
41
40
|
attr_accessor :application, :current_user, :current_locale, :current_language, :current_translator,
|
42
41
|
:current_source, :current_component, :block_options, :cookie_params, :access_token, :tools_enabled
|
43
42
|
|
44
|
-
def self.access_token
|
45
|
-
@access_token
|
46
|
-
end
|
47
|
-
|
48
|
-
def self.access_token=(token)
|
49
|
-
@access_token = token
|
50
|
-
end
|
51
|
-
|
52
43
|
def cookie_name
|
53
44
|
"trex_#{self.application.key}"
|
54
45
|
end
|
@@ -58,18 +49,9 @@ module Tml
|
|
58
49
|
|
59
50
|
host = opts[:host] || Tml.config.application[:host]
|
60
51
|
|
61
|
-
Tml::Session.access_token ||= begin
|
62
|
-
self.access_token = opts[:token] || Tml.config.application[:token]
|
63
|
-
self.access_token ||= opts[:access_token] || Tml.config.application[:access_token]
|
64
|
-
end
|
65
|
-
|
66
52
|
Tml.cache.reset_version
|
67
53
|
|
68
|
-
self.application = Tml::Application.new(:host => host
|
69
|
-
|
70
|
-
if Tml.cache.read_only?
|
71
|
-
self.class.access_token = self.application.access_token
|
72
|
-
end
|
54
|
+
self.application = Tml::Application.new(:host => host).fetch
|
73
55
|
|
74
56
|
# Tml.logger.info(self.cookie_params.inspect)
|
75
57
|
|
data/lib/tml/version.rb
CHANGED