Fix rubocop offenses.

This commit is contained in:
Guo Xiang Tan 2017-08-02 15:09:07 +09:00
parent 17dda66400
commit 639784ec81
1 changed files with 30 additions and 28 deletions

View File

@ -87,16 +87,18 @@ SQL
post.save!
if defined?(UserAction::SOLVED)
UserAction.log_action!(action_type: UserAction::SOLVED,
UserAction.log_action!(
action_type: UserAction::SOLVED,
user_id: post.user_id,
acting_user_id: guardian.user.id,
target_post_id: post.id,
target_topic_id: post.topic_id)
target_topic_id: post.topic_id
)
end
unless current_user.id == post.user_id
Notification.create!(notification_type: Notification.types[:custom],
Notification.create!(
notification_type: Notification.types[:custom],
user_id: post.user_id,
topic_id: post.topic_id,
post_number: post.post_number,
@ -108,7 +110,7 @@ SQL
)
end
if (auto_close_hours = SiteSetting.solved_topics_auto_close_hours) > 0 and !topic.closed
if (auto_close_hours = SiteSetting.solved_topics_auto_close_hours) > (0) && !topic.closed
topic.set_or_create_timer(
TopicTimer.types[:close],
auto_close_hours,