Commit edd4b6115b309320fee708ae8bd81523d272c12d

Authored by Austin Smith
1 parent 32b3d0c544
Exists in master

taskboard updates for rails 4

Showing 4 changed files with 6 additions and 4 deletions Side-by-side Diff

app/controllers/taskboard_controller.rb View file @ edd4b61
... ... @@ -6,7 +6,7 @@
6 6 helper_method :column_manager_locals
7 7  
8 8 def index
9   - @columns = TaskBoardColumn.find_all_by_project_id(@project.id, :order => 'weight')
  9 + @columns = TaskBoardColumn.where(:project_id => @project.id).order('weight').all()
10 10 @status_names = Hash.new
11 11 IssueStatus.select([:id, :name]).each do |status|
12 12 @status_names[status.id] = status.name
app/models/status_bucket.rb View file @ edd4b61
1 1 class StatusBucket < ActiveRecord::Base
2   - default_scope order('weight ASC')
  2 + default_scope {
  3 + order('weight ASC')
  4 + }
3 5 belongs_to :issue_status
4 6 belongs_to :task_board_column
5 7 unloadable
app/models/task_board_column.rb View file @ edd4b61
... ... @@ -22,7 +22,7 @@
22 22 if include_subprojects
23 23 subproject_ids = project.self_and_descendants.collect {|p| p.id}.flatten
24 24 end
25   - self.issue_statuses.order(:weight).each do |status|
  25 + self.issue_statuses.order('status_buckets.weight').each do |status|
26 26 @column_statuses[status.id] = Array.new
27 27 issues = Issue.select("issues.*, tbi.is_archived, tbi.#{order_column} as weight, tbi.issue_id") \
28 28 .joins('LEFT OUTER JOIN task_board_issues AS tbi ON tbi.issue_id = issues.id') \
app/views/my_taskboard/index.html.erb View file @ edd4b61
... ... @@ -5,7 +5,7 @@
5 5 <%= label_tag "priority", "Priority" %>
6 6 <%= select_tag("priority", options_for_select([['Any', '0']] + IssuePriority.all.collect { |m| [ m.name, m.id ] } )) %>
7 7 <%= label_tag "project", "Project" %>
8   - <%= select_tag("project", options_for_select([['Any', '0']] + Project.all(:order => 'name', :conditions => {:status => 1}).select{|project| @user.allowed_to?(:log_time, project)}.collect{|p| [p.name, p.id] })) %>
  8 + <%= select_tag("project", options_for_select([['Any', '0']] + Project.order(:name).where(:status => 1).all().select{|project| @user.allowed_to?(:log_time, project)}.collect{|p| [p.name, p.id] })) %>
9 9 </p>
10 10 </div>
11 11