0.0
No commit activity in last 3 years
No release in over 3 years
Until ActiveSupport gets its act together, fix to_json ArgumentError (2 for 1), StackLevelTooDeep, etc. errors
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

to_json_fix¶ ↑

class Time
  def to_json(*)
    super nil
  end
end

class Date
  def to_json(*)
    super nil
  end
end

class Symbol
  def to_json(*)
    to_s.to_json
  end
end

if defined?(ActiveSupport::HashWithIndifferentAccess)
  class ActiveSupport::HashWithIndifferentAccess
    def to_json(*)
      to_hash.to_json
    end
  end
end

if defined?(ActiveRecord::Base)
  class ActiveRecord::Base
    def to_json(*args)
      super nil
    end
  end
end

Copyright © 2010 Seamus Abshere. See LICENSE for details.