Do we want to log if the watch word was updated instead of created?
WatchedWord.where(action: action).find_each do |watched_word|
I think we should wrap this in a DB transaction or at least only log after
watched_word.destroy! does not raise an error.
I think we should avoid repeating this code twice and refactor it into the
For consistency with other actions, maybe
describe '#log_watched_words_creation' do
describe '#log_watched_words_deletion' do
I believe it’s fine to log update as created otherwise we’ll need to add another user action for update type and keep track of watched word updates.
Thanks for the review @tgxworld! Updated the PR per feedback.
get_details is too generic considering the method is defined in the
staff_action_logger. Otherwise, I think moving this method to the
WatchedWord model might not be a bad idea.
I agree. I’ve the method to