Skip to content

Commit

Permalink
Touch contents updated_at column in pure SQL
Browse files Browse the repository at this point in the history
Instead of touching each content on its own.
  • Loading branch information
tvdeyen committed Oct 31, 2019
1 parent a1c2afa commit a76e6ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/concerns/alchemy/content_touching.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def self.included(base)
#
def touch_contents
return unless respond_to?(:contents)
contents.each(&:touch)
contents.update_all(updated_at: Time.current)
end
end
end

0 comments on commit a76e6ae

Please sign in to comment.