Project

General

Profile

Patch #32909 » pick.patch

Pavel Rosický, 2020-01-28 23:03

View differences:

app/models/issue_query.rb (working copy)
"1=0"
end
when "~"
root_id, lft, rgt = Issue.where(:id => value.first.to_i).pluck(:root_id, :lft, :rgt).first
root_id, lft, rgt = Issue.where(:id => value.first.to_i).pick(:root_id, :lft, :rgt)
if root_id && lft && rgt
"#{Issue.table_name}.root_id = #{root_id} AND #{Issue.table_name}.lft > #{lft} AND #{Issue.table_name}.rgt < #{rgt}"
else
......
"1=0"
end
when "~"
root_id, lft, rgt = Issue.where(:id => value.first.to_i).pluck(:root_id, :lft, :rgt).first
root_id, lft, rgt = Issue.where(:id => value.first.to_i).pick(:root_id, :lft, :rgt)
if root_id && lft && rgt
"#{Issue.table_name}.root_id = #{root_id} AND #{Issue.table_name}.lft < #{lft} AND #{Issue.table_name}.rgt > #{rgt}"
else
app/models/user.rb (working copy)
return @project_ids_by_role if @project_ids_by_role
group_class = anonymous? ? GroupAnonymous : GroupNonMember
group_id = group_class.pluck(:id).first
group_id = group_class.pick(:id)
members = Member.joins(:project, :member_roles).
where("#{Project.table_name}.status <> 9").
lib/redmine/nested_set/issue_nested_set.rb (working copy)
end
def reload_nested_set_values
self.root_id, self.lft, self.rgt = self.class.where(:id => id).pluck(:root_id, :lft, :rgt).first
self.root_id, self.lft, self.rgt = self.class.where(:id => id).pick(:root_id, :lft, :rgt)
end
def save_nested_set_values
lib/redmine/nested_set/project_nested_set.rb (working copy)
if siblings_rgt
siblings_rgt + 1
elsif parent_id
parent_lft = self.class.where(:id => parent_id).pluck(:lft).first
parent_lft = self.class.where(:id => parent_id).pick(:lft)
raise "Project id=#{id} with parent_id=#{parent_id}: parent missing or without 'lft' value" unless parent_lft
parent_lft + 1
else
......
end
def reload_nested_set_values
self.lft, self.rgt = Project.where(:id => id).pluck(:lft, :rgt).first
self.lft, self.rgt = Project.where(:id => id).pick(:lft, :rgt)
end
def save_nested_set_values
(1-1/3)