From b1b40ef36f4a20adcf6f0f80c30b0b0a675d00de Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Mon, 29 Jun 2015 17:02:31 -0300 Subject: [PATCH] Fix task type scope --- app/models/task.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/task.rb b/app/models/task.rb index 85e4ddc..da6004e 100644 --- a/app/models/task.rb +++ b/app/models/task.rb @@ -242,7 +242,7 @@ class Task < ActiveRecord::Base scope :canceled, :conditions => { :status => Task::Status::CANCELLED } scope :closed, :conditions => { :status => [Task::Status::CANCELLED, Task::Status::FINISHED] } scope :opened, :conditions => { :status => [Task::Status::ACTIVE, Task::Status::HIDDEN] } - scope :of, lambda { |type| conditions = type ? "type LIKE '#{type}'" : "1=1"; {:conditions => [conditions]} } + scope :of, lambda { |type| conditions = type ? "tasks.type LIKE '#{type}'" : "1=1"; {:conditions => [conditions]} } scope :order_by, lambda { |attribute, ord| {:order => "#{attribute} #{ord}"} } scope :like, lambda { |field, value| where("LOWER(#{field}) LIKE ?", "%#{value.downcase}%") if value} scope :pending_all, lambda { |profile, filter_type, filter_text| -- libgit2 0.21.2