remove UserActionObserver, replace with after_save and service

interestingly there was some left over dead code from when stars
existed in the topic_users table
This commit is contained in:
Sam
2016-12-22 15:03:40 +11:00
parent 96c70c74a1
commit 2f6a4cc6de
22 changed files with 60 additions and 42 deletions

View File

@ -132,8 +132,6 @@ SQL
if rows == 0
create_missing_record(user_id, topic_id, attrs)
else
observe_after_save_callbacks_for topic_id, user_id
end
end
@ -203,8 +201,6 @@ SQL
if rows == 0
change(user_id, topic_id, last_visited_at: now, first_visited_at: now)
else
observe_after_save_callbacks_for(topic_id, user_id)
end
end
@ -323,11 +319,6 @@ SQL
end
end
def observe_after_save_callbacks_for(topic_id, user_id)
TopicUser.where(topic_id: topic_id, user_id: user_id).each do |topic_user|
UserActionObserver.instance.after_save topic_user
end
end
end
def self.update_post_action_cache(opts={})