mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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)
|
def auto_notification(user_id, topic_id, reason, notification_level)
|
||||||
should_change = TopicUser
|
should_change = TopicUser
|
||||||
.where(user_id: user_id, topic_id: topic_id)
|
.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?
|
.exists?
|
||||||
|
|
||||||
change(user_id, topic_id, notification_level: notification_level, notifications_reason_id: reason) if should_change
|
change(user_id, topic_id, notification_level: notification_level, notifications_reason_id: reason) if should_change
|
||||||
end
|
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)
|
change(user_id, topic_id, notification_level: notification_level, notifications_reason_id: reason)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user