caboose-cms 0.7.9 → 0.7.10

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: 8e6f3997789d5f79d8f6a9ca3cf6aae4659b0096
4
- data.tar.gz: 015785dca3640c8f002b0da75b565936539e5cc2
3
+ metadata.gz: 9a70827123c9a2ab434f55b1a2d172d92f3b9443
4
+ data.tar.gz: ff1c55fab2918425ca9fd94b60f751002cff0514
5
5
  SHA512:
6
- metadata.gz: fa51f2cc0c88e18d7e3d9b074e8883beffe4bb9a340c52d9dadf2413c9c8fee71489cf3f4a1909e63dcac49bb17041cfaa0a3d510a275420cadfbe2173b159df
7
- data.tar.gz: 3165baf5b25f0c03bc07e673245be41b6e8ec1388acb4d81b8cc2a4135ef8b71fcf4728b8ffee0fbc7fb3648bccd627466be3496c6287c3f0300ab9f76528c16
6
+ metadata.gz: 2340fce950be8789cf970d01e630bdc226ab23e68bf3c68d14a596c1fec23065b716c14e87be0e256137e47c66dc53749924901f88ad79aea0256901d5707d2c
7
+ data.tar.gz: b9f9dd51c50f10986c27b0e1ff2c3550e8d8fc2a683b5018553cb2245a122c4032a9ed911f12ad5491261bb032e224ad10a82b027eb412a234a4e3fc7512a782
@@ -71,10 +71,24 @@ class Caboose::Block < ActiveRecord::Base
71
71
  return b.file
72
72
  end
73
73
  #return b.image if b.block_type.field_type == 'image'
74
- #return b.file if b.block_type.field_type == 'file'
74
+ #return b.file if b.block_type.field_type == 'file'
75
75
  return b.value
76
76
  end
77
77
 
78
+ def rendered_child_value(name, options)
79
+ b = self.child(name)
80
+ return nil if b.nil?
81
+ if b.block_type.field_type == 'image'
82
+ return b.media.image if b.media
83
+ return b.image
84
+ end
85
+ if b.block_type.field_type == 'file'
86
+ return b.media.file if b.media
87
+ return b.file
88
+ end
89
+ return options[:view].render(:inline => b.value, :locals => options)
90
+ end
91
+
78
92
  def child(name)
79
93
  Caboose::Block.where("parent_id = ? and name = ?", self.id, name).first
80
94
  end
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.7.9'
2
+ VERSION = '0.7.10'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.9
4
+ version: 0.7.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-19 00:00:00.000000000 Z
11
+ date: 2015-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg