Apply Style/RedundantReturn rubocop rule
We were already following this pattern most of the time.
This commit is contained in:
@@ -409,6 +409,9 @@ Style/Proc:
|
|||||||
Style/RedundantFreeze:
|
Style/RedundantFreeze:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Style/RedundantReturn:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Style/SafeNavigation:
|
Style/SafeNavigation:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ module SignatureSheetsHelper
|
|||||||
text_help += tag(:br)
|
text_help += tag(:br)
|
||||||
text_help += t("admin.signature_sheets.new.text_help.required_fields_structure_note")
|
text_help += t("admin.signature_sheets.new.text_help.required_fields_structure_note")
|
||||||
|
|
||||||
return text_help
|
text_help
|
||||||
end
|
end
|
||||||
|
|
||||||
def example_text_help
|
def example_text_help
|
||||||
@@ -45,6 +45,6 @@ module SignatureSheetsHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
text_example += "#{example_1}; #{example_2}"
|
text_example += "#{example_1}; #{example_2}"
|
||||||
return text_example
|
text_example
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -165,6 +165,6 @@ class Debate < ApplicationRecord
|
|||||||
def self.debates_orders(user)
|
def self.debates_orders(user)
|
||||||
orders = %w[hot_score confidence_score created_at relevance]
|
orders = %w[hot_score confidence_score created_at relevance]
|
||||||
orders << "recommendations" if Setting["feature.user.recommendations_on_debates"] && user&.recommended_debates
|
orders << "recommendations" if Setting["feature.user.recommendations_on_debates"] && user&.recommended_debates
|
||||||
return orders
|
orders
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class I18nContent < ApplicationRecord
|
|||||||
return output.update({ path => input }) unless input.is_a? Hash
|
return output.update({ path => input }) unless input.is_a? Hash
|
||||||
|
|
||||||
input.map { |key, value| flat_hash(value, [path, key].compact.join("."), output) }
|
input.map { |key, value| flat_hash(value, [path, key].compact.join("."), output) }
|
||||||
return output
|
output
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.content_for(tab)
|
def self.content_for(tab)
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ class Proposal < ApplicationRecord
|
|||||||
def self.proposals_orders(user)
|
def self.proposals_orders(user)
|
||||||
orders = %w[hot_score confidence_score created_at relevance archival_date]
|
orders = %w[hot_score confidence_score created_at relevance archival_date]
|
||||||
orders << "recommendations" if Setting["feature.user.recommendations_on_proposals"] && user&.recommended_proposals
|
orders << "recommendations" if Setting["feature.user.recommendations_on_proposals"] && user&.recommended_proposals
|
||||||
return orders
|
orders
|
||||||
end
|
end
|
||||||
|
|
||||||
def skip_user_verification?
|
def skip_user_verification?
|
||||||
|
|||||||
@@ -52,11 +52,11 @@ class SignatureSheet < ApplicationRecord
|
|||||||
|
|
||||||
def parse_postal_code(required_fields_to_verify)
|
def parse_postal_code(required_fields_to_verify)
|
||||||
if Setting.force_presence_date_of_birth? && Setting.force_presence_postal_code?
|
if Setting.force_presence_date_of_birth? && Setting.force_presence_postal_code?
|
||||||
return required_fields_to_verify[2]
|
required_fields_to_verify[2]
|
||||||
elsif Setting.force_presence_postal_code?
|
elsif Setting.force_presence_postal_code?
|
||||||
return required_fields_to_verify[1]
|
required_fields_to_verify[1]
|
||||||
else
|
else
|
||||||
return nil
|
nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ def documentable_redirected_to_resource_show_or_navigate_to
|
|||||||
find("a", text: "Not now, go to my proposal")
|
find("a", text: "Not now, go to my proposal")
|
||||||
click_on "Not now, go to my proposal"
|
click_on "Not now, go to my proposal"
|
||||||
rescue
|
rescue
|
||||||
return
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def documentable_attach_new_file(path, success = true)
|
def documentable_attach_new_file(path, success = true)
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ def imageable_redirected_to_resource_show_or_navigate_to
|
|||||||
find("a", text: "Not now, go to my proposal")
|
find("a", text: "Not now, go to my proposal")
|
||||||
click_on "Not now, go to my proposal"
|
click_on "Not now, go to my proposal"
|
||||||
rescue
|
rescue
|
||||||
return
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def imageable_attach_new_file(_imageable_factory_name, path, success = true)
|
def imageable_attach_new_file(_imageable_factory_name, path, success = true)
|
||||||
|
|||||||
Reference in New Issue
Block a user