Class: ActiveRecord::XmlSerializer

Inherits:
Object
  • Object
show all
Defined in:
lib/restfulx/rx_active_record.rb

Overview

Change the xml serializer so that ‘?’s are stripped from attribute names. This makes it possible to serialize methods that end in a question mark, like ‘valid?’ or ‘is_true?’

Defined Under Namespace

Classes: Attribute

Instance Method Summary collapse

Instance Method Details

#add_tag(attribute) ⇒ Object

Strips ‘?’ from serialized method names



308
309
310
311
312
313
314
# File 'lib/restfulx/rx_active_record.rb', line 308

def add_tag(attribute)
  builder.tag!(
    dasherize? ? attribute.display_name.dasherize : attribute.display_name,
    attribute.value.to_s,
    attribute.decorations(!options[:skip_types])
  )
end