Sha256: dcba648abd432b9e8f4e3f233eb752736aad657d7f97039f653d254abec72f7d
Contents?: true
Size: 860 Bytes
Versions: 3
Compression:
Stored size: 860 Bytes
Contents
require 'active_record/serializer_override' def app_serialize(aObject,aScope) result = case aObject.class when Fixnum then aObject.to_s when Bignum then aObject.to_s when Array sz_class = ActiveModel::ArraySerializer sz_class.new(aObject).to_json(:scope => aScope, :root => false) when String then aObject when FalseClass then 'false' when TrueClass then 'true' when Symbol then aObject.to_s #when Hash #sz_class = ActiveModel::Serializer #sz_class.new(aObject).to_json(:scope => aScope, :root => false) else sz_class = aObject.respond_to?(:active_model_serializer) && aObject.send(:active_model_serializer) sz_class = DefaultKojacSerializer if !sz_class && aObject.is_a?(ActiveModel) if sz_class sz_class.new(aObject).to_json(:scope => aScope, :root => false) else aObject.to_json end end result end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
kojac-0.9.1 | lib/kojac/app_serialize.rb |
kojac-0.9.0.1 | lib/kojac/app_serialize.rb |
kojac-0.9.0 | lib/kojac/app_serialize.rb |