make rubocop happy
This commit is contained in:
parent
3a29ba71a3
commit
8d14d55fc5
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue