Class: CmsTemplate
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- CmsTemplate
- Defined in:
- app/models/cms_template.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'app/models/cms_template.rb', line 4 def @options end |
Instance Method Details
#content=(value) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'app/models/cms_template.rb', line 11 def content=(value) if value && value.is_a?(String) # filter suspicious content... go overboard for now, fine-tune later perhaps value.gsub!(/<(%.*?(exec|system)\s?\(.*?\s*%)>/, '<\1>') value.gsub!(/<(%.*?\%x\s?\[.*?\s*%)>/, '<\1>') value.gsub!(/<(%.*?`.*?\s*%)>/, '<\1>') end super(value) end |
#deserialize_yaml ⇒ Object
21 22 23 |
# File 'app/models/cms_template.rb', line 21 def deserialize_yaml @options = YAML.load(self.) if self. end |
#serialize_yaml ⇒ Object
25 26 27 |
# File 'app/models/cms_template.rb', line 25 def serialize_yaml self. = YAML.dump(@options) end |