Merge pull request #921 from nirnanaaa/postgres-truefalse

removed t's and f's from models
This commit is contained in:
Sam 2013-05-30 21:38:26 -07:00
commit d2c1eb090e
3 changed files with 6 additions and 6 deletions

View File

@ -34,9 +34,9 @@ class Category < ActiveRecord::Base
scope :secured, ->(guardian = nil) {
ids = guardian.secure_category_ids if guardian
if ids.present?
where("categories.secure ='f' or categories.id in (:cats)", cats: ids)
where("NOT categories.secure or categories.id in (:cats)", cats: ids)
else
where("categories.secure ='f'")
where("NOT categories.secure")
end
}

View File

@ -38,11 +38,11 @@ class Group < ActiveRecord::Base
real_ids = case name
when :admins
"SELECT u.id FROM users u WHERE u.admin = 't'"
"SELECT u.id FROM users u WHERE u.admin"
when :moderators
"SELECT u.id FROM users u WHERE u.moderator = 't'"
"SELECT u.id FROM users u WHERE u.moderator"
when :staff
"SELECT u.id FROM users u WHERE u.moderator = 't' OR u.admin = 't'"
"SELECT u.id FROM users u WHERE u.moderator OR u.admin"
when :trust_level_1, :trust_level_2, :trust_level_3, :trust_level_4, :trust_level_5
"SELECT u.id FROM users u WHERE u.trust_level = #{id-10}"
end

View File

@ -60,7 +60,7 @@ class User < ActiveRecord::Base
scope :admins, ->{ where(admin: true) }
scope :moderators, ->{ where(moderator: true) }
scope :staff, ->{ where("moderator = 't' or admin = 't'") }
scope :staff, ->{ where("moderator or admin ") }
module NewTopicDuration
ALWAYS = -1