sunrise-cms 0.6.7 → 0.6.8

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.
@@ -1,4 +1,4 @@
1
- <%= manage_form_for @record do |f| -%>
1
+ <%= manage_form_for @record, :html => { :multipart => true } do |f| -%>
2
2
  <%= render :partial => 'sunrise/shared/parent' %>
3
3
 
4
4
  <div class="post-edit-holder">
@@ -3,7 +3,7 @@
3
3
  <div class="wysiwyg-holder">
4
4
  <% @settings.each do |key, value| -%>
5
5
  <div class="padder">
6
- <%= f.input key, :value => value %>
6
+ <%= f.input key, :value => value, :required => false %>
7
7
  </div>
8
8
  <% end -%>
9
9
  </div>
@@ -1,5 +1,5 @@
1
- # encoding: utf-8
2
- require "active_support/cache/memory_store"
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::MemoryStore.new
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.to_s]
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
@@ -1,3 +1,3 @@
1
1
  module Sunrise
2
- VERSION = "0.6.7".freeze
2
+ VERSION = "0.6.8".freeze
3
3
  end