Sha256: a7a54a0b338eda61b31bca7a9fba50a4c2bed3f2527636b58223da3680811fc5

Contents?: true

Size: 341 Bytes

Versions: 1

Compression:

Stored size: 341 Bytes

Contents

# frozen_string_literal: true

class ValidationError < ActiveRecord::Base
  def self.track(invalid_model)
    create!(invalid_model_name: invalid_model.class.name,
            invalid_model_id: invalid_model.id,
            details: invalid_model.errors.details,
            action: invalid_model.persisted? ? "update" : "create")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
validation_errors-0.1.0 lib/validation_error.rb