From 899feb1d6794b90f317bd7e9d8b470f00d889f7f Mon Sep 17 00:00:00 2001 From: Kevin Pheasey Date: Tue, 15 Dec 2015 14:40:24 -0500 Subject: [PATCH] Add touch :self. --- lib/active_touch/touch_job.rb | 6 +++++- lib/active_touch/version.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/active_touch/touch_job.rb b/lib/active_touch/touch_job.rb index 68793c1..a4f3aae 100644 --- a/lib/active_touch/touch_job.rb +++ b/lib/active_touch/touch_job.rb @@ -2,7 +2,11 @@ module ActiveTouch class TouchJob < ActiveJob::Base def perform(record, association, after_touch) - associated = record.send(association) + if association == 'self' + associated = record + else + associated = record.send(association) + end if associated.is_a? ActiveRecord::Base associated.update_columns(updated_at: record.updated_at) diff --git a/lib/active_touch/version.rb b/lib/active_touch/version.rb index 2e2f95e..4b7d914 100644 --- a/lib/active_touch/version.rb +++ b/lib/active_touch/version.rb @@ -1,3 +1,3 @@ module ActiveTouch - VERSION = '1.0.0' + VERSION = '1.1.0' end