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 45
45:         def after_update
46:           super
47:           recalculate_values_hashes
48:         end

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

[Source]

    # File lib/sequel/plugins/modification_detection.rb, line 51
51:         def calculate_values_hashes
52:           @values_hashes || recalculate_values_hashes
53:         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 57
57:         def changed_columns
58:           cc = super
59:           changed = []
60:           v = @values
61:           if vh = @values_hashes
62:             (vh.keys - cc).each{|c| changed << c unless v.has_key?(c) && vh[c] == v[c].hash}
63:           end
64:           cc + changed
65:         end

[Validate]