Skip to content

Commit

Permalink
Add touch :self.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Pheasey committed Dec 15, 2015
1 parent c21b6ef commit 899feb1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/active_touch/touch_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/active_touch/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module ActiveTouch
VERSION = '1.0.0'
VERSION = '1.1.0'
end

0 comments on commit 899feb1

Please sign in to comment.