module Ecom module Core class ApplicationSerializer include FastJsonapi::ObjectSerializer def serializable_hash data = super[:data] if data.is_a? Hash data[:attributes] elsif data.is_a? Array data.map { |d| d[:attributes] } elsif data.nil? nil else data end end end end end