make rubocop happy

This commit is contained in:
Régis Hanol 2017-10-06 16:48:11 +02:00 committed by GitHub
parent 3a29ba71a3
commit 8d14d55fc5
1 changed files with 2 additions and 2 deletions

View File

@ -40,13 +40,13 @@ class TopicUser < ActiveRecord::Base
def auto_notification(user_id, topic_id, reason, notification_level)
should_change = TopicUser
.where(user_id: user_id, topic_id: topic_id)
.where("notifications_reason_id IS NULL OR (notification_level < :min AND notification_level > :max)", min: notification_level, max: notification_levels[:regular])
.where("notifications_reason_id IS NULL OR (notification_level < :min AND notification_level > :max)", min: notification_level, max: notification_levels[:regular])
.exists?
change(user_id, topic_id, notification_level: notification_level, notifications_reason_id: reason) if should_change
end
def auto_notification_for_staging(user_id, topic_id, reason, notification_level=notification_levels[:watching])
def auto_notification_for_staging(user_id, topic_id, reason, notification_level = notification_levels[:watching])
change(user_id, topic_id, notification_level: notification_level, notifications_reason_id: reason)
end