summaryrefslogtreecommitdiffstats
path: root/app/models/time_entry.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-11-10 11:10:32 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-11-10 11:10:32 +0000
commit050b05689fe2a6561f1e642bf3783cb0ffd64329 (patch)
treeea3d75eacf9cf2cb43a4db27b61979a3e96eceaf /app/models/time_entry.rb
parent3e6622cd43abefbfaecb5ce54fbad74dd45ed114 (diff)
downloadredmine-050b05689fe2a6561f1e642bf3783cb0ffd64329.tar.gz
redmine-050b05689fe2a6561f1e642bf3783cb0ffd64329.zip
use "do end" instead of {} at ActiveRecord scope lambda of app/models/time_entry.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20329 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/time_entry.rb')
-rw-r--r--app/models/time_entry.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/models/time_entry.rb b/app/models/time_entry.rb
index 0dc343475..b81eef787 100644
--- a/app/models/time_entry.rb
+++ b/app/models/time_entry.rb
@@ -58,17 +58,17 @@ class TimeEntry < ActiveRecord::Base
before_validation :set_author_if_nil
validate :validate_time_entry
- scope :visible, lambda {|*args|
+ scope :visible, (lambda do |*args|
joins(:project).
where(TimeEntry.visible_condition(args.shift || User.current, *args))
- }
- scope :left_join_issue, lambda {
+ end)
+ scope :left_join_issue, (lambda do
joins("LEFT OUTER JOIN #{Issue.table_name} ON #{Issue.table_name}.id = #{TimeEntry.table_name}.issue_id")
- }
- scope :on_issue, lambda {|issue|
+ end)
+ scope :on_issue, (lambda do |issue|
joins(:issue).
where("#{Issue.table_name}.root_id = #{issue.root_id} AND #{Issue.table_name}.lft >= #{issue.lft} AND #{Issue.table_name}.rgt <= #{issue.rgt}")
- }
+ end)
safe_attributes 'user_id', 'hours', 'comments', 'project_id',
'issue_id', 'activity_id', 'spent_on',