You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
280 B
Ruby
14 lines
280 B
Ruby
10 years ago
|
# 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
|