Module Sequel::Plugins::Touch::InstanceMethods
In: lib/sequel/plugins/touch.rb

Methods

Public Instance methods

Touch all of the model‘s touched_associations when destroying the object.

[Source]

    # File lib/sequel/plugins/touch.rb, line 80
80:         def after_destroy
81:           super
82:           touch_associations
83:         end

Touch all of the model‘s touched_associations when updating the object.

[Source]

    # File lib/sequel/plugins/touch.rb, line 86
86:         def after_update
87:           super
88:           touch_associations
89:         end

Touch the model object. If a column is not given, use the model‘s touch_column as the column. If the column to use is not one of the model‘s columns, just save the changes to the object instead of attempting to a value that doesn‘t exist.

[Source]

     # File lib/sequel/plugins/touch.rb, line 95
 95:         def touch(column=nil)
 96:           if column
 97:             set(column=>touch_instance_value)
 98:           else
 99:             column = model.touch_column
100:             set(column=>touch_instance_value) if columns.include?(column)
101:           end
102:           save_changes
103:         end

[Validate]