engine/app/models/locomotive/editable_short_text.rb

21 lines
438 B
Ruby
Raw Normal View History

module Locomotive
class EditableShortText < EditableElement
## fields ##
2012-01-25 21:07:10 +00:00
field :content, :localize => true
## methods ##
2012-01-25 21:07:10 +00:00
def content_with_localization
value = self.content_without_localization
value.blank? ? self.default_content : value
end
2012-01-25 21:07:10 +00:00
alias_method_chain :content, :localization
def as_json(options = {})
Locomotive::EditableShortTextPresenter.new(self).as_json
end
end
end