mirror of
https://github.com/redmine/redmine.git
synced 2025-12-16 05:20:28 +01:00
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
This commit is contained in:
@@ -58,17 +58,17 @@ class TimeEntry < ActiveRecord::Base
|
|||||||
before_validation :set_author_if_nil
|
before_validation :set_author_if_nil
|
||||||
validate :validate_time_entry
|
validate :validate_time_entry
|
||||||
|
|
||||||
scope :visible, lambda {|*args|
|
scope :visible, (lambda do |*args|
|
||||||
joins(:project).
|
joins(:project).
|
||||||
where(TimeEntry.visible_condition(args.shift || User.current, *args))
|
where(TimeEntry.visible_condition(args.shift || User.current, *args))
|
||||||
}
|
end)
|
||||||
scope :left_join_issue, lambda {
|
scope :left_join_issue, (lambda do
|
||||||
joins("LEFT OUTER JOIN #{Issue.table_name} ON #{Issue.table_name}.id = #{TimeEntry.table_name}.issue_id")
|
joins("LEFT OUTER JOIN #{Issue.table_name} ON #{Issue.table_name}.id = #{TimeEntry.table_name}.issue_id")
|
||||||
}
|
end)
|
||||||
scope :on_issue, lambda {|issue|
|
scope :on_issue, (lambda do |issue|
|
||||||
joins(: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}")
|
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',
|
safe_attributes 'user_id', 'hours', 'comments', 'project_id',
|
||||||
'issue_id', 'activity_id', 'spent_on',
|
'issue_id', 'activity_id', 'spent_on',
|
||||||
|
|||||||
Reference in New Issue
Block a user