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 83
83:         def after_destroy
84:           super
85:           touch_associations
86:         end

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

[Source]

    # File lib/sequel/plugins/touch.rb, line 89
89:         def after_update
90:           super
91:           touch_associations
92:         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 98
 98:         def touch(column=nil)
 99:           if column
100:             set(column=>touch_instance_value)
101:           else
102:             column = model.touch_column
103:             set(column=>touch_instance_value) if columns.include?(column)
104:           end
105:           save_changes
106:         end

[Validate]