Class: SpudSnippet
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- SpudSnippet
- Defined in:
- app/models/spud_snippet.rb
Instance Method Summary collapse
Instance Method Details
#content_processed ⇒ Object
19 20 21 22 23 24 |
# File 'app/models/spud_snippet.rb', line 19 def content_processed if read_attribute(:content_processed).blank? self.update_column(:content_processed, postprocess_content) end return read_attribute(:content_processed) end |
#content_processed=(content) ⇒ Object
15 16 17 |
# File 'app/models/spud_snippet.rb', line 15 def content_processed=(content) write_attribute(:content_processed,content) end |
#postprocess_content ⇒ Object
10 11 12 13 |
# File 'app/models/spud_snippet.rb', line 10 def postprocess_content template = Liquid::Template.parse(self.content) self.content_processed = template.render() end |