Sha256: d54479b4fccfbbec99ad7500d89adb4a8e3508fc3c45a33e45bcb32ec4bee0c6

Contents?: true

Size: 498 Bytes

Versions: 3

Compression:

Stored size: 498 Bytes

Contents

require 'active_model_serializers'

module Mks
  module Rate
    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

3 entries across 3 versions & 1 rubygems

Version Path
mks_rate-1.0.5 app/models/mks/rate/application_record.rb
mks_rate-1.0.4 app/models/mks/rate/application_record.rb
mks_rate-1.0.3 app/models/mks/rate/application_record.rb