cleanup: rubocop: fix Layout/BlockAlignment in app/models/time_entry.rb

git-svn-id: http://svn.redmine.org/redmine/trunk@19028 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA
2019-11-09 16:05:07 +00:00
parent 7867b4dcd5
commit fb84731bcd
2 changed files with 6 additions and 12 deletions

View File

@@ -14,13 +14,6 @@
Layout/AlignHash: Layout/AlignHash:
Enabled: false Enabled: false
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleAlignWith.
# SupportedStylesAlignWith: either, start_of_block, start_of_line
Layout/BlockAlignment:
Exclude:
- 'app/models/time_entry.rb'
# Cop supports --auto-correct. # Cop supports --auto-correct.
Layout/BlockEndNewline: Layout/BlockEndNewline:
Exclude: Exclude:

View File

@@ -28,11 +28,12 @@ class TimeEntry < ActiveRecord::Base
belongs_to :activity, :class_name => 'TimeEntryActivity' belongs_to :activity, :class_name => 'TimeEntryActivity'
acts_as_customizable acts_as_customizable
acts_as_event :title => Proc.new { |o| acts_as_event :title =>
related = o.issue if o.issue && o.issue.visible? Proc.new {|o|
related ||= o.project related = o.issue if o.issue && o.issue.visible?
"#{l_hours(o.hours)} (#{related.event_title})" related ||= o.project
}, "#{l_hours(o.hours)} (#{related.event_title})"
},
:url => Proc.new {|o| {:controller => 'timelog', :action => 'index', :project_id => o.project, :issue_id => o.issue}}, :url => Proc.new {|o| {:controller => 'timelog', :action => 'index', :project_id => o.project, :issue_id => o.issue}},
:author => :user, :author => :user,
:group => :issue, :group => :issue,