Class: ActiveRecord::Base
- Inherits:
-
Object
- Object
- ActiveRecord::Base
- Defined in:
- lib/source_route/json_overrides/activerecord_associations_association.rb
Instance Method Summary collapse
-
#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.
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.
15 16 17 |
# File 'lib/source_route/json_overrides/activerecord_associations_association.rb', line 15 def to_json( = nil) JSON.dump(to_s) end |