Sha256: fded7379f050aad01b8737994b03f9540d982c2fc6c3817f22cbf0445f360592

Contents?: true

Size: 412 Bytes

Versions: 44

Compression:

Stored size: 412 Bytes

Contents

Audited::Audit.class_eval do
  before_validation do
    if account_id.nil?
      if auditable.respond_to?(:account_id)
        self.account_id = auditable.account_id
      elsif auditable_type == 'Account'
        self.account_id = auditable.id
      elsif ActsAsTenant.current_tenant.present?
        self.account = ActsAsTenant.current_tenant
      end
    end
  end

  belongs_to :account, optional: true
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
pg_rails-7.6.23 pg_engine/app/overrides/audited_audit.rb
pg_rails-7.6.22 pg_engine/app/overrides/audited_audit.rb
pg_rails-7.6.22.pre.3 pg_engine/app/overrides/audited_audit.rb
pg_rails-7.6.22.pre.2 pg_engine/app/overrides/audited_audit.rb
pg_rails-7.6.22.pre.1 pg_engine/app/overrides/audited_audit.rb
pg_rails-7.6.21 pg_engine/app/overrides/audited_audit.rb
pg_rails-7.6.21.pre.11 pg_engine/app/overrides/audited_audit.rb
pg_rails-7.6.21.pre.10 pg_engine/app/overrides/audited_audit.rb
pg_rails-7.6.21.pre.9 pg_engine/app/overrides/audited_audit.rb
pg_rails-7.6.21.pre.8 pg_engine/app/overrides/audited_audit.rb
pg_rails-7.6.21.pre.7 pg_engine/app/overrides/audited_audit.rb
pg_rails-7.6.21.pre.6 pg_engine/app/overrides/audited_audit.rb
pg_rails-7.6.21.pre.5 pg_engine/app/overrides/audited_audit.rb
pg_rails-7.6.21.pre.4 pg_engine/app/overrides/audited_audit.rb
pg_rails-7.6.21.pre.3 pg_engine/app/overrides/audited_audit.rb
pg_rails-7.6.21.pre.2 pg_engine/app/overrides/audited_audit.rb
pg_rails-7.6.21.pre.1 pg_engine/app/overrides/audited_audit.rb
pg_rails-7.6.20 pg_engine/app/overrides/audited_audit.rb
pg_rails-7.6.19 pg_engine/app/overrides/audited_audit.rb
pg_rails-7.6.18 pg_engine/app/overrides/audited_audit.rb