From 0a09925dcef1976970bc2674432f69d46786c38f Mon Sep 17 00:00:00 2001 From: mhasbini Date: Fri, 31 Mar 2017 18:11:28 +0300 Subject: Enable Style/Proc cop for rubocop --- app/mailers/base_mailer.rb | 4 ++-- app/models/milestone.rb | 2 +- app/models/service.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/mailers/base_mailer.rb b/app/mailers/base_mailer.rb index 79c3c2e62c5..a9b6b33eb5c 100644 --- a/app/mailers/base_mailer.rb +++ b/app/mailers/base_mailer.rb @@ -5,8 +5,8 @@ class BaseMailer < ActionMailer::Base attr_accessor :current_user helper_method :current_user, :can? - default from: Proc.new { default_sender_address.format } - default reply_to: Proc.new { default_reply_to_address.format } + default from: proc { default_sender_address.format } + default reply_to: proc { default_reply_to_address.format } def can? Ability.allowed?(current_user, action, subject) diff --git a/app/models/milestone.rb b/app/models/milestone.rb index e85d5709624..ac205b9b738 100644 --- a/app/models/milestone.rb +++ b/app/models/milestone.rb @@ -30,7 +30,7 @@ class Milestone < ActiveRecord::Base validates :title, presence: true, uniqueness: { scope: :project_id } validates :project, presence: true - validate :start_date_should_be_less_than_due_date, if: Proc.new { |m| m.start_date.present? && m.due_date.present? } + validate :start_date_should_be_less_than_due_date, if: proc { |m| m.start_date.present? && m.due_date.present? } strip_attributes :title diff --git a/app/models/service.rb b/app/models/service.rb index e73f7e5d1a3..54550177744 100644 --- a/app/models/service.rb +++ b/app/models/service.rb @@ -25,7 +25,7 @@ class Service < ActiveRecord::Base belongs_to :project, inverse_of: :services has_one :service_hook - validates :project_id, presence: true, unless: Proc.new { |service| service.template? } + validates :project_id, presence: true, unless: proc { |service| service.template? } scope :visible, -> { where.not(type: 'GitlabIssueTrackerService') } scope :issue_trackers, -> { where(category: 'issue_tracker') } -- cgit v1.2.1