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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f63e4a06922bcc3cf9320007593f95d2dae4a56
4
- data.tar.gz: 3fbc708695a2f581cda77d9294d0a2705394d70f
3
+ metadata.gz: 7dfa9825fec6a1e21a56397b36f0500d6acd7182
4
+ data.tar.gz: 3d0fb223036b7c4de384b0d981b89ab15c9370e5
5
5
  SHA512:
6
- metadata.gz: 9cf76d4b54dbcf0b2a1dce894a1c3bb8cc211b56e555470df4f4400d4aae837221f2913804af2379a98654a6437423153a453d51258e8f06e518efd2fbe3ca5b
7
- data.tar.gz: 3021c86c61295bce08620cf3f8b5dbb64e89ef0b247872df5ff17dac21713c8d809cce3b7a33749546ad120af680827473d7f3e863b90d513773113404ecf98c
6
+ metadata.gz: 61af8e4daa5ed35395f6584fbdf1cdd0cb946f655da920428bde39bd3badca0a9ea66c177bf23c6224b0e0111fe9091a19f29b11fd3a842dfe2649f260923129
7
+ data.tar.gz: bff7716db1356c521eae172c50501222c6e53aa9309db59928a05dfd7fd1ff593d037fe0801691c52aaf0bc40f7bfd5083f046fbf8bb150eea0c940fcc74fdd8
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.7.12'
2
+ VERSION = '0.7.13'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.12
4
+ version: 0.7.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry