app/models/spud_snippet.rb in tb_cms-1.2.3 vs app/models/spud_snippet.rb in tb_cms-1.3.beta1

- old
+ new

@@ -1,25 +1,25 @@ class SpudSnippet < ActiveRecord::Base include CmsDeprecatedMultisite - validates :name, :presence => true - validates_uniqueness_of :name + validates :name, presence: true + validates :name, uniqueness: true acts_as_tb_liquid_content def postprocess_content - template = Liquid::Template.parse(self.content) + template = Liquid::Template.parse(content) self.content_processed = template.render() end def content_processed=(content) - write_attribute(:content_processed,content) + self[:content_processed] = content end def content_processed - if read_attribute(:content_processed).blank? - self.update_column(:content_processed, postprocess_content) + if self[:content_processed].blank? + update_column(:content_processed, postprocess_content) end - return read_attribute(:content_processed) + return self[:content_processed] end end