Commit b1b40ef36f4a20adcf6f0f80c30b0b0a675d00de

Authored by Victor Costa
1 parent e21366f1

Fix task type scope

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
app/models/task.rb
@@ -242,7 +242,7 @@ class Task < ActiveRecord::Base @@ -242,7 +242,7 @@ class Task < ActiveRecord::Base
242 scope :canceled, :conditions => { :status => Task::Status::CANCELLED } 242 scope :canceled, :conditions => { :status => Task::Status::CANCELLED }
243 scope :closed, :conditions => { :status => [Task::Status::CANCELLED, Task::Status::FINISHED] } 243 scope :closed, :conditions => { :status => [Task::Status::CANCELLED, Task::Status::FINISHED] }
244 scope :opened, :conditions => { :status => [Task::Status::ACTIVE, Task::Status::HIDDEN] } 244 scope :opened, :conditions => { :status => [Task::Status::ACTIVE, Task::Status::HIDDEN] }
245 - scope :of, lambda { |type| conditions = type ? "type LIKE '#{type}'" : "1=1"; {:conditions => [conditions]} } 245 + scope :of, lambda { |type| conditions = type ? "tasks.type LIKE '#{type}'" : "1=1"; {:conditions => [conditions]} }
246 scope :order_by, lambda { |attribute, ord| {:order => "#{attribute} #{ord}"} } 246 scope :order_by, lambda { |attribute, ord| {:order => "#{attribute} #{ord}"} }
247 scope :like, lambda { |field, value| where("LOWER(#{field}) LIKE ?", "%#{value.downcase}%") if value} 247 scope :like, lambda { |field, value| where("LOWER(#{field}) LIKE ?", "%#{value.downcase}%") if value}
248 scope :pending_all, lambda { |profile, filter_type, filter_text| 248 scope :pending_all, lambda { |profile, filter_type, filter_text|