Skip to content

Commit

Permalink
Changing to PG (Heroku deployment) and fix a PG bug with Post.writers
Browse files Browse the repository at this point in the history
  • Loading branch information
mrDoktar committed May 14, 2010
1 parent 03a81dc commit d0161b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ gem 'coderay'

gem 'acts-as-taggable-on'

gem 'mysql'
gem 'pg'

gem 'rubycas-client'

Expand Down
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ class User < ActiveRecord::Base
has_many :posts

scope :admins, where(:admin => true)
scope :writers, joins("RIGHT JOIN posts ON posts.user_id = users.id").group(:user_id)
scope :writers, select("DISTINCT users.*").joins("RIGHT JOIN posts ON posts.user_id = users.id")
end

0 comments on commit d0161b2

Please sign in to comment.