sunrise-cms 0.6.7 → 0.6.8
Sign up to get free protection for your applications and to get access to all the features.
- data/app/views/sunrise/manager/_form.html.erb +1 -1
- data/app/views/sunrise/settings/_form.html.erb +1 -1
- data/lib/sunrise/models/settings.rb +8 -16
- data/lib/sunrise/version.rb +1 -1
- metadata +607 -595
- data/spec/dummy/log/development.log +0 -151
- data/spec/dummy/log/test.log +0 -144000
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
require "active_support/cache/
|
1
|
+
require "dalli"
|
2
|
+
require "active_support/cache/dalli_store"
|
3
3
|
|
4
4
|
module Sunrise
|
5
5
|
module Models
|
@@ -14,7 +14,7 @@ module Sunrise
|
|
14
14
|
|
15
15
|
# cache must follow the contract of ActiveSupport::Cache. Defaults to no-op.
|
16
16
|
cattr_accessor :cache
|
17
|
-
self.cache = ActiveSupport::Cache::
|
17
|
+
self.cache = ::ActiveSupport::Cache::DalliStore.new
|
18
18
|
|
19
19
|
# options passed to cache.fetch() and cache.write(). example: {:expires_in => 5.minutes}
|
20
20
|
cattr_accessor :cache_options
|
@@ -71,7 +71,7 @@ module Sunrise
|
|
71
71
|
result = defaults.dup
|
72
72
|
|
73
73
|
query.all.each do |record|
|
74
|
-
result[record.var] = record.value
|
74
|
+
result[record.var.to_sym] = record.value
|
75
75
|
end
|
76
76
|
|
77
77
|
result.with_indifferent_access
|
@@ -83,7 +83,7 @@ module Sunrise
|
|
83
83
|
if (var = target(var_name)).present?
|
84
84
|
var.value
|
85
85
|
else
|
86
|
-
defaults[var_name.
|
86
|
+
defaults[var_name.to_sym]
|
87
87
|
end
|
88
88
|
end
|
89
89
|
end
|
@@ -131,22 +131,14 @@ module Sunrise
|
|
131
131
|
attrs.each do |key, value|
|
132
132
|
self[key] = value
|
133
133
|
end
|
134
|
+
|
135
|
+
cache.clear
|
134
136
|
end
|
135
137
|
|
136
138
|
def to_key
|
137
139
|
['settings']
|
138
140
|
end
|
139
141
|
end
|
140
|
-
|
141
|
-
#get the value field, YAML decoded
|
142
|
-
def value
|
143
|
-
YAML::load(self[:value])
|
144
|
-
end
|
145
|
-
|
146
|
-
#set the value field, YAML encoded
|
147
|
-
def value=(new_value)
|
148
|
-
self[:value] = new_value.to_yaml
|
149
|
-
end
|
150
142
|
end
|
151
143
|
end
|
152
|
-
end
|
144
|
+
end
|
data/lib/sunrise/version.rb
CHANGED