Skip to content
Browse files

Revert "Postgres is stricter than mysql about boolean types"

That broke EVERYTHING.

This reverts commit 2883a66.
  • Loading branch information...
1 parent 2883a66 commit 08ffd8a27180485e3914d7d1c98b4b72a35fe64f paul committed Mar 25, 2011
Showing with 1 addition and 12 deletions.
  1. +1 −12 app/models/code.rb
View
13 app/models/code.rb
@@ -1,5 +1,5 @@
class Code < ActiveRecord::Base
- has_many :refactors, :conditions => Code.refactor_not_spam, :dependent => :destroy
+ has_many :refactors, :conditions => 'spam = 0', :dependent => :destroy
belongs_to :user
has_permalink :title
@@ -25,17 +25,6 @@ class Code < ActiveRecord::Base
def to_param
"#{id}-#{permalink}"
end
-
- def self.refactor_not_spam
- case connection.adapter_name
- when /MySQL/
- 'spam = 0'
- when /PostgreSQL/
- 'spam = false'
- else
- 'true'
- end
- end
def user_name
user.name

0 comments on commit 08ffd8a

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