Module Sequel::Plugins::ModificationDetection::InstanceMethods
In: lib/sequel/plugins/modification_detection.rb

Methods

Public Instance methods

Recalculate the column value hashes after updating.

[Source]

    # File lib/sequel/plugins/modification_detection.rb, line 48
48:         def after_update
49:           super
50:           recalculate_values_hashes
51:         end

Calculate the column hash values if they haven‘t been already calculated.

[Source]

    # File lib/sequel/plugins/modification_detection.rb, line 54
54:         def calculate_values_hashes
55:           @values_hashes || recalculate_values_hashes
56:         end

Detect which columns have been modified by comparing the cached hash value to the hash of the current value.

[Source]

    # File lib/sequel/plugins/modification_detection.rb, line 60
60:         def changed_columns
61:           cc = super
62:           changed = []
63:           v = @values
64:           if vh = @values_hashes
65:             (vh.keys - cc).each{|c| changed << c unless v.has_key?(c) && vh[c] == v[c].hash}
66:           end
67:           cc + changed
68:         end

[Validate]