asciinema.org/lib/active_support_json_proxy.rb
2014-08-30 20:10:49 +02:00

14 lines
280 B
Ruby

# Remove this and replace with `JSON` after upgrading to Rails 4.2
class ActiveSupportJsonProxy
def self.dump(object)
ActiveSupport::JSON.encode(object) unless object.nil?
end
def self.load(string)
ActiveSupport::JSON.decode(string) if string.present?
end
end