Inline anemic method
This commit is contained in:
@@ -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
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user