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

Methods

Public Instance methods

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

[Source]

    # File lib/sequel/plugins/touch.rb, line 82
82:         def after_create
83:           super
84:           touch_associations
85:         end

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

[Source]

    # File lib/sequel/plugins/touch.rb, line 88
88:         def after_destroy
89:           super
90:           touch_associations
91:         end

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

[Source]

    # File lib/sequel/plugins/touch.rb, line 94
94:         def after_update
95:           super
96:           touch_associations
97:         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 103
103:         def touch(column=nil)
104:           if column
105:             set(column=>touch_instance_value)
106:           else
107:             column = model.touch_column
108:             set(column=>touch_instance_value) if columns.include?(column)
109:           end
110:           save_changes
111:         end

[Validate]