Class: Storytime::Autosave

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
ScopedToSite
Defined in:
app/models/storytime/autosave.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#draft_contentObject

Returns the value of attribute draft_content.



8
9
10
# File 'app/models/storytime/autosave.rb', line 8

def draft_content
  @draft_content
end

Instance Method Details

#update_autosave_contentObject



12
13
14
15
16
17
18
# File 'app/models/storytime/autosave.rb', line 12

def update_autosave_content
  self.content = if Storytime.post_sanitizer.blank?
    @draft_content
  else
    Storytime.post_sanitizer.call(@draft_content)
  end
end