Method: AttrJson::Model#as_json

Defined in:
lib/attr_json/model.rb

#as_json(options = nil) ⇒ Object

ActiveRecord JSON serialization will insist on calling this, instead of the specified type's #serialize, at least in some cases. So it's important we define it -- the default #as_json added by ActiveSupport will serialize all instance variables, which is not what we want.



394
395
396
# File 'lib/attr_json/model.rb', line 394

def as_json(options=nil)
  serializable_hash(options)
end