Sha256: 4635ff67618334bd8e4698178ac4dc28ac15e0fccedaeb7e31ae08f23a5b8a30

Contents?: true

Size: 594 Bytes

Versions: 2

Compression:

Stored size: 594 Bytes

Contents

class User < ActiveRecord::Base
  include ArTransactionChanges

  class ConnectionDetails
    attr_accessor :client_ip

    def initialize(client_ip:)
      @client_ip = client_ip
    end
  end

  serialize :connection_details, Array
  serialize :notes, Array

  attr_accessor :stored_transaction_changes

  after_commit :store_transaction_changes_for_tests

  def store_transaction_changes_for_tests
    @stored_transaction_changes = transaction_changed_attributes.reduce({}) do |changes, (attr_name, value)|
      changes[attr_name] = [value, send(attr_name)]
      changes
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ar_transaction_changes-1.1.9 test/models/user.rb
ar_transaction_changes-1.1.8 test/models/user.rb