Module: Sequel::Plugins::Touch::InstanceMethods

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

### Methods

after_destroy after_update touch

### Public Instance methods

after_destroy()

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

[Source]

        # File lib/sequel/plugins/touch.rb, line 70
    70:         def after_destroy
    71:           super
    72:           touch_associations
    73:         end

after_update()

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

[Source]

        # File lib/sequel/plugins/touch.rb, line 76
    76:         def after_update
    77:           super
    78:           touch_associations
    79:         end

touch(column=nil)

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 85
    85:         def touch(column=nil)
    86:           if column
    87:             set(column=>touch_instance_value)
    88:           else
    89:             column = model.touch_column
    90:             set(column=>touch_instance_value) if columns.include?(column)
    91:           end
    92:           save_changes
    93:         end

[Validate]