caboose-cms 0.7.12 → 0.7.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/caboose/page.rb +9 -0
- data/lib/caboose/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: 7dfa9825fec6a1e21a56397b36f0500d6acd7182
|
4
|
+
data.tar.gz: 3d0fb223036b7c4de384b0d981b89ab15c9370e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61af8e4daa5ed35395f6584fbdf1cdd0cb946f655da920428bde39bd3badca0a9ea66c177bf23c6224b0e0111fe9091a19f29b11fd3a842dfe2649f260923129
|
7
|
+
data.tar.gz: bff7716db1356c521eae172c50501222c6e53aa9309db59928a05dfd7fd1ff593d037fe0801691c52aaf0bc40f7bfd5083f046fbf8bb150eea0c940fcc74fdd8
|
data/app/models/caboose/page.rb
CHANGED
@@ -369,6 +369,15 @@ class Caboose::Page < ActiveRecord::Base
|
|
369
369
|
return nil if f.nil?
|
370
370
|
fv = Caboose::PageCustomFieldValue.create(:page_id => self.id, :page_custom_field_id => f.id, :key => key, :value => f.default_value, :sort_order => f.sort_order)
|
371
371
|
end
|
372
|
+
f = fv.page_custom_field
|
373
|
+
return fv.value if f.nil?
|
374
|
+
case f.field_type
|
375
|
+
when Caboose::PageCustomField::FIELD_TYPE_TEXT then return fv.value
|
376
|
+
when Caboose::PageCustomField::FIELD_TYPE_SELECT then return fv.value
|
377
|
+
when Caboose::PageCustomField::FIELD_TYPE_CHECKBOX then return fv.value == '1'
|
378
|
+
when Caboose::PageCustomField::FIELD_TYPE_DATE then return fv.value ? Date.strptime(fv.value, "%Y-%m-%d") : nil
|
379
|
+
when Caboose::PageCustomField::FIELD_TYPE_DATETIME then return fv.value ? DateTime.strptime(fv.value, "%Y-%m-%d %H:%i:%s") : nil
|
380
|
+
end
|
372
381
|
return fv.value
|
373
382
|
end
|
374
383
|
|
data/lib/caboose/version.rb
CHANGED