Sha256: 0f14632fcce76ca9cd120c749047643c12ebff0b0bcb424a81665fef94b9cda0

Contents?: true

Size: 497 Bytes

Versions: 4

Compression:

Stored size: 497 Bytes

Contents

require 'active_model_serializers'

module Mks
  module Edm
    class ApplicationRecord < ActiveRecord::Base
      self.abstract_class = true

      def json(data = nil)
        if data.nil?
          ActiveModelSerializers::SerializableResource.new(self).as_json
        else
          ActiveModelSerializers::SerializableResource.new(data).as_json
        end
      end

      def self.json(data)
        ActiveModelSerializers::SerializableResource.new(data).as_json
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mks_edm-1.0.5 app/models/mks/edm/application_record.rb
mks_edm-1.0.4 app/models/mks/edm/application_record.rb
mks_edm-1.0.2 app/models/mks/edm/application_record.rb
mks_edm-1.0.1 app/models/mks/edm/application_record.rb