Skip to content
Browse files

Specify columns in types_for_project for Postgres GROUP BY compatibility

  • Loading branch information...
1 parent 04b4eb9 commit d768bae2e8d97e5e116cbfdcaf934d73fcc200a6 @Simon143 Simon143 committed Nov 27, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/controllers/assets_controller.rb
View
2 app/controllers/assets_controller.rb
@@ -64,7 +64,7 @@ def types_for_project
wheres << "(#{mapping['project_id']} = #{@project.id})"
end
- return Attachment.find(:all, {:group => "container_type", :conditions => wheres.join(' OR '), :joins => joins.join(' ')}).collect(&:container_type).compact
+ return Attachment.find(:all, {:select => "container_type", :group => "container_type", :conditions => wheres.join(' OR '), :joins => joins.join(' ')}).collect(&:container_type).compact
end
def find_project

0 comments on commit d768bae

Please sign in to comment.
Something went wrong with that request. Please try again.