mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Enable unless cops
We discussed the use of `unless` internally and decided to enforce available rules from rubocop to restrict its most problematic uses.
This commit is contained in:
committed by
Loïc Guitaut
parent
87de3c2319
commit
f7c57fbc19
@@ -541,7 +541,7 @@ class PostsController < ApplicationController
|
||||
] if post_revision.modifications["category_id"].present? &&
|
||||
post_revision.modifications["category_id"][0] != topic.category.id
|
||||
end
|
||||
return render_json_error(I18n.t("revert_version_same")) unless changes.length > 0
|
||||
return render_json_error(I18n.t("revert_version_same")) if changes.length <= 0
|
||||
changes[:edit_reason] = I18n.with_locale(SiteSetting.default_locale) do
|
||||
I18n.t("reverted_to_version", version: post_revision.number.to_i - 1)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user