asciinema.org/lib/active_support_json_proxy.rb

14 lines
280 B
Ruby
Raw Normal View History

2014-08-30 17:38:47 +00:00
# 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