Apply Style/Proc rubocop rule
While I tend to use `Proc.new`, using `proc` is shorter and more consistent since we also use `lambda`.
This commit is contained in:
@@ -403,6 +403,9 @@ Style/OrAssignment:
|
|||||||
Style/PercentLiteralDelimiters:
|
Style/PercentLiteralDelimiters:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Style/Proc:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Style/RedundantFreeze:
|
Style/RedundantFreeze:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class ApplicationMailer < ActionMailer::Base
|
class ApplicationMailer < ActionMailer::Base
|
||||||
helper :settings
|
helper :settings
|
||||||
helper :application
|
helper :application
|
||||||
default from: Proc.new { "#{Setting["mailer_from_name"]} <#{Setting["mailer_from_address"]}>" }
|
default from: proc { "#{Setting["mailer_from_name"]} <#{Setting["mailer_from_address"]}>" }
|
||||||
layout "mailer"
|
layout "mailer"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class Poll::Question < ApplicationRecord
|
|||||||
|
|
||||||
validates_translation :title, presence: true, length: { minimum: 4 }
|
validates_translation :title, presence: true, length: { minimum: 4 }
|
||||||
validates :author, presence: true
|
validates :author, presence: true
|
||||||
validates :poll_id, presence: true, if: Proc.new { |question| question.poll.nil? }
|
validates :poll_id, presence: true, if: proc { |question| question.poll.nil? }
|
||||||
|
|
||||||
validates_associated :votation_type
|
validates_associated :votation_type
|
||||||
accepts_nested_attributes_for :question_answers, reject_if: :all_blank, allow_destroy: true
|
accepts_nested_attributes_for :question_answers, reject_if: :all_blank, allow_destroy: true
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ Devise.setup do |config|
|
|||||||
# Configure the e-mail address which will be shown in Devise::Mailer,
|
# Configure the e-mail address which will be shown in Devise::Mailer,
|
||||||
# note that it will be overwritten if you use your own mailer class
|
# note that it will be overwritten if you use your own mailer class
|
||||||
# with default "from" parameter.
|
# with default "from" parameter.
|
||||||
config.mailer_sender = Proc.new { "'#{Setting["mailer_from_name"]}' <#{Setting["mailer_from_address"]}>" }
|
config.mailer_sender = proc { "'#{Setting["mailer_from_name"]}' <#{Setting["mailer_from_address"]}>" }
|
||||||
|
|
||||||
# Configure the class responsible to send e-mails.
|
# Configure the class responsible to send e-mails.
|
||||||
config.mailer = "DeviseMailer"
|
config.mailer = "DeviseMailer"
|
||||||
|
|||||||
Reference in New Issue
Block a user