Class | RR::LoggedChange |
In: |
lib/rubyrep/logged_change.rb
|
Parent: | Object |
TYPE_CHANGES | = | { 'NI' => 'I', 'NU' => 'U', 'ND' => 'D', 'II' => 'I', # [1] 'IU' => 'I', 'ID' => 'N', 'UI' => 'U', # [1] 'UU' => 'U', 'UD' => 'D', 'DI' => 'U', 'DU' => 'U', # [1] 'DD' => 'D', # [1] } |
A hash describing how the change state morph based on newly found change
records.
[1]: such cases shouldn‘t happen. but just in case, choose the most sensible solution. |
|
SHORT_TYPES | = | { 'I' => :insert, 'U' => :update, 'D' => :delete, 'N' => :no_change | A hash translating the short 1-letter types to the according symbols | |
LONG_TYPES | = | SHORT_TYPES.invert | A hash translating the symbold types to according 1 letter types |
first_changed_at | [RW] | When the first change to the record happened |
key | [RW] | A column_name => value hash identifying the changed record |
last_changed_at | [RW] | When the last change to the record happened |
loader | [RW] | The current LoggedChangeLoader |
new_key | [RW] | Only used for updates: a column_name => value hash of the original primary key of the updated record |
table | [RW] | The name of the changed table |
type | [RW] | Type of the change. Either :insert, :update or :delete. |
Creates a new LoggedChange instance.
Returns a column_name => value hash based on the provided raw_key string (which is a string in the format as read directly from the change log table).
Loads the change as per table and key. Works if the LoggedChange instance is totally new or was already loaded before.