Class: ActiveRecord::Associations::Association

Inherits:
Object
  • Object
show all
Defined in:
lib/source_route/json_overrides/activerecord_associations_association.rb

Instance Method Summary collapse

Instance Method Details

#to_json(options = nil) ⇒ Object

dump association can trigger ActiveSupport::JSON::Encoding::CircularReferenceError when use rails ~> 4.0.1 I try other json gems to fix it, but all failed. That’s why I override it here.



7
8
9
# File 'lib/source_route/json_overrides/activerecord_associations_association.rb', line 7

def to_json(options = nil)
  Oj.dump(to_s)
end