2011-10-30 23:02:41 +00:00
|
|
|
module Locomotive
|
|
|
|
class EditableShortText < EditableElement
|
|
|
|
|
|
|
|
## fields ##
|
|
|
|
field :content
|
|
|
|
|
|
|
|
## methods ##
|
|
|
|
|
|
|
|
def content
|
|
|
|
self.read_attribute(:content).blank? ? self.default_content : self.read_attribute(:content)
|
|
|
|
end
|
|
|
|
|
2011-11-21 01:27:05 +00:00
|
|
|
def as_json(options = {})
|
|
|
|
Locomotive::EditableShortTextPresenter.new(self).as_json
|
|
|
|
end
|
|
|
|
|
2011-10-30 23:02:41 +00:00
|
|
|
end
|
|
|
|
end
|