Inline anemic method

This commit is contained in:
David Heinemeier Hansson
2025-04-18 17:13:11 +02:00
parent aae6c7b1a2
commit f368b9f9c9
2 changed files with 1 additions and 5 deletions
-4
View File
@@ -6,10 +6,6 @@ module Card::Eventable
before_create { self.last_active_at = Time.current }
end
def touch_last_active_at
touch :last_active_at
end
def track_event(action, creator: Current.user, **particulars)
if published?
event = find_or_capture_event_summary.events.create! action: action, creator: creator, card: self, particulars: particulars
+1 -1
View File
@@ -10,7 +10,7 @@ class Event < ApplicationRecord
scope :chronologically, -> { order created_at: :asc, id: :desc }
after_create -> { card.touch_last_active_at }
after_create -> { card.touch(:last_active_at) }
def commented?
action == "commented"