also render null values in formatables

pull/2554/head
Jan Sandbrink 10 years ago
parent c37579def9
commit b38eb09c5b
  1. 9
      lib/api/decorators/formatable.rb

@ -42,14 +42,17 @@ module API
property :format,
exec_context: :decorator,
getter: -> (*) { @format == '' ? 'plain' : @format },
writable: false
writable: false,
render_nil: true
property :raw,
exec_context: :decorator,
getter: -> (*) { represented }
getter: -> (*) { represented },
render_nil: true
property :html,
exec_context: :decorator,
getter: -> (*) { to_html },
writable: false
writable: false,
render_nil: true
def to_html
format_text(represented, format: @format, object: @object)

Loading…
Cancel
Save