honey-cms 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cms/attribute.rb +9 -4
- data/lib/cms/helper.rb +1 -0
- metadata +1 -1
data/lib/cms/attribute.rb
CHANGED
@@ -5,9 +5,14 @@ class CMS::Attribute
|
|
5
5
|
@name = name
|
6
6
|
@format = format
|
7
7
|
@options = options
|
8
|
-
@attr_options =
|
9
|
-
|
10
|
-
|
8
|
+
@attr_options = if self.format.boolean?
|
9
|
+
{
|
10
|
+
null: false,
|
11
|
+
default: false
|
12
|
+
}
|
13
|
+
else
|
14
|
+
{}
|
15
|
+
end
|
11
16
|
end
|
12
17
|
|
13
18
|
def format
|
@@ -76,7 +81,7 @@ class CMS::Attribute
|
|
76
81
|
|
77
82
|
def reference_to
|
78
83
|
if reference?
|
79
|
-
@reference_to ||= CMS::Configuration.types.find{|t| t.name == @options['reference_to']}
|
84
|
+
@reference_to ||= CMS::Configuration.types.find{ |t| t.name == @options['reference_to'] }
|
80
85
|
end
|
81
86
|
end
|
82
87
|
|
data/lib/cms/helper.rb
CHANGED