Merge pull request #62 from jonasheinrich/fix/fix_find_in_calendar_block

Fix deprecated finder method in calendar block
pull/6827/head
ulferts 9 years ago
commit 37381c8cab
  1. 5
      app/views/my_projects_overviews/blocks/_calendar.html.erb

@ -26,8 +26,7 @@ See doc/COPYRIGHT.md for more details.
<% end %>
<% calendar = Redmine::Helpers::Calendar.new(Date.today, current_language, :week)
calendar.events = WorkPackage.visible.find :all,
:conditions => ["#{WorkPackage.table_name}.project_id in (#{@user.projects.collect{|m| m.id}.join(',')}) AND ((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?))", calendar.startdt, calendar.enddt, calendar.startdt, calendar.enddt],
:include => [:project, :type, :priority, :assigned_to] unless @user.projects.empty? %>
calendar.events = WorkPackage.visible.where("#{WorkPackage.table_name}.project_id in (#{@user.projects.collect{|m| m.id}.join(',')}) AND ((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?))", calendar.startdt, calendar.enddt, calendar.startdt, calendar.enddt)
.includes(:project, :type, :priority, :assigned_to) unless @user.projects.empty? %>
<%= render :partial => 'common/calendar', :locals => {:calendar => calendar } %>

Loading…
Cancel
Save