Skip to content

Commit

Permalink
Fixed a rare invalid sql with selected issues. Discovered while testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
edavis10 committed Mar 17, 2010
1 parent d02fc8d commit 9e02a9c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/kanban_issue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ class KanbanIssue < ActiveRecord::Base

# For acts_as_list
def scope_condition
"state = #{connection.quote(state)} AND user_id = #{connection.quote(user_id)}"
if user_id
"state = #{connection.quote(state)} AND user_id = #{connection.quote(user_id)}"
else
"state = #{connection.quote(state)} AND user_id IS NULL"
end
end

validates_presence_of :position
Expand Down

0 comments on commit 9e02a9c

Please sign in to comment.