Sha256: 9d0ee37c3d94e1b219bc7bc26fc5e9c8ed11fe309da760fa980fe03e12b17463

Contents?: true

Size: 629 Bytes

Versions: 17

Compression:

Stored size: 629 Bytes

Contents

module Errdo
  class ErrorOccurrence < ActiveRecord::Base

    self.table_name = "#{Errdo.error_name.to_s.singularize}_occurrences"

    serialize :param_values
    serialize :cookie_values
    serialize :header_values

    belongs_to :error, counter_cache: :occurrence_count
    belongs_to :experiencer, polymorphic: true

    after_create :update_last_occurrence
    after_create :update_last_experiencer

    private

    def update_last_occurrence
      error.update(last_occurred_at: created_at) if error
    end

    def update_last_experiencer
      error.update(last_experiencer: experiencer) if error
    end

  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
errdo-0.12.6 app/models/errdo/error_occurrence.rb
errdo-0.12.5 app/models/errdo/error_occurrence.rb
errdo-0.12.4 app/models/errdo/error_occurrence.rb
errdo-0.12.3 app/models/errdo/error_occurrence.rb
errdo-0.12.2 app/models/errdo/error_occurrence.rb
errdo-0.12.1 app/models/errdo/error_occurrence.rb
errdo-0.12.0 app/models/errdo/error_occurrence.rb
errdo-0.11.6 app/models/errdo/error_occurrence.rb
errdo-0.11.5 app/models/errdo/error_occurrence.rb
errdo-0.11.4 app/models/errdo/error_occurrence.rb
errdo-0.11.3 app/models/errdo/error_occurrence.rb
errdo-0.11.2 app/models/errdo/error_occurrence.rb
errdo-0.11.1 app/models/errdo/error_occurrence.rb
errdo-0.11.0 app/models/errdo/error_occurrence.rb
errdo-0.10.0 app/models/errdo/error_occurrence.rb
errdo-0.9.1 app/models/errdo/error_occurrence.rb
errdo-0.9.0 app/models/errdo/error_occurrence.rb