mirror of
https://github.com/meineerde/redmine.git
synced 2025-10-17 17:01:01 +00:00
Use pluck instead of map in MyHelper (#26711).
Patch by jwjw yy. git-svn-id: http://svn.redmine.org/redmine/trunk@17036 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
9ae7bc8152
commit
2ecb29bfcb
@ -78,7 +78,7 @@ module MyHelper
|
||||
def render_calendar_block(block, settings)
|
||||
calendar = Redmine::Helpers::Calendar.new(User.current.today, current_language, :week)
|
||||
calendar.events = Issue.visible.
|
||||
where(:project_id => User.current.projects.map(&:id)).
|
||||
where(:project_id => User.current.projects.pluck(:id)).
|
||||
where("(start_date>=? and start_date<=?) or (due_date>=? and due_date<=?)", calendar.startdt, calendar.enddt, calendar.startdt, calendar.enddt).
|
||||
includes(:project, :tracker, :priority, :assigned_to).
|
||||
references(:project, :tracker, :priority, :assigned_to).
|
||||
@ -139,7 +139,7 @@ module MyHelper
|
||||
|
||||
def render_news_block(block, settings)
|
||||
news = News.visible.
|
||||
where(:project_id => User.current.projects.map(&:id)).
|
||||
where(:project_id => User.current.projects.pluck(:id)).
|
||||
limit(10).
|
||||
includes(:project, :author).
|
||||
references(:project, :author).
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user