Add and apply Style/NegatedIfElseCondition rule
This rule was added in Rubocop 1.2.0, and will make developers who hate negative conditions particularly happy.
This commit is contained in:
@@ -469,6 +469,9 @@ Style/MethodDefParentheses:
|
||||
Style/MutableConstant:
|
||||
Enabled: true
|
||||
|
||||
Style/NegatedIfElseCondition:
|
||||
Enabled: true
|
||||
|
||||
Style/Not:
|
||||
Enabled: true
|
||||
|
||||
|
||||
@@ -50,18 +50,18 @@ class Document < ApplicationRecord
|
||||
end
|
||||
|
||||
def prefix(attachment, _style)
|
||||
if !attachment.instance.persisted?
|
||||
"cached_attachments/user/#{attachment.instance.user_id}"
|
||||
else
|
||||
if attachment.instance.persisted?
|
||||
":attachment/:id_partition"
|
||||
else
|
||||
"cached_attachments/user/#{attachment.instance.user_id}"
|
||||
end
|
||||
end
|
||||
|
||||
def custom_hash_data(attachment)
|
||||
original_filename = if !attachment.instance.persisted?
|
||||
attachment.instance.attachment_file_name
|
||||
else
|
||||
original_filename = if attachment.instance.persisted?
|
||||
attachment.instance.title
|
||||
else
|
||||
attachment.instance.attachment_file_name
|
||||
end
|
||||
"#{attachment.instance.user_id}/#{original_filename}"
|
||||
end
|
||||
|
||||
@@ -52,10 +52,10 @@ class Image < ApplicationRecord
|
||||
end
|
||||
|
||||
def prefix(attachment, _style)
|
||||
if !attachment.instance.persisted?
|
||||
"cached_attachments/user/#{attachment.instance.user_id}"
|
||||
else
|
||||
if attachment.instance.persisted?
|
||||
":attachment/:id_partition"
|
||||
else
|
||||
"cached_attachments/user/#{attachment.instance.user_id}"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="<%= results_type == :compatible ? "success" : "js-discarded" %>"
|
||||
style="<%= results_type != :compatible ? "display: none" : "" %>"
|
||||
style="<%= results_type == :compatible ? "" : "display: none" %>"
|
||||
id="<%= results_type %>-container">
|
||||
|
||||
<h4><%= title %></h4>
|
||||
|
||||
@@ -20,12 +20,12 @@ class ConsulFormBuilder < FoundationRailsHelper::FormBuilder
|
||||
end
|
||||
|
||||
def check_box(attribute, options = {})
|
||||
if options[:label] != false
|
||||
if options[:label] == false
|
||||
super
|
||||
else
|
||||
label = tag.span sanitize(label_text(attribute, options[:label])), class: "checkbox"
|
||||
|
||||
super(attribute, options.merge(label: label, label_options: label_options_for(options)))
|
||||
else
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user