mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 16:24:55 +00:00
removed t and f 's from group model
removed t and f 's from user model as mentioned in #919 removed t's and f's from category model
This commit is contained in:
parent
00c1c4691d
commit
364113a4d5
@ -34,9 +34,9 @@ class Category < ActiveRecord::Base
|
|||||||
scope :secured, ->(guardian = nil) {
|
scope :secured, ->(guardian = nil) {
|
||||||
ids = guardian.secure_category_ids if guardian
|
ids = guardian.secure_category_ids if guardian
|
||||||
if ids.present?
|
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
|
else
|
||||||
where("categories.secure ='f'")
|
where("NOT categories.secure")
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,11 +38,11 @@ class Group < ActiveRecord::Base
|
|||||||
|
|
||||||
real_ids = case name
|
real_ids = case name
|
||||||
when :admins
|
when :admins
|
||||||
"SELECT u.id FROM users u WHERE u.admin = 't'"
|
"SELECT u.id FROM users u WHERE u.admin"
|
||||||
when :moderators
|
when :moderators
|
||||||
"SELECT u.id FROM users u WHERE u.moderator = 't'"
|
"SELECT u.id FROM users u WHERE u.moderator"
|
||||||
when :staff
|
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
|
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}"
|
"SELECT u.id FROM users u WHERE u.trust_level = #{id-10}"
|
||||||
end
|
end
|
||||||
|
@ -60,7 +60,7 @@ class User < ActiveRecord::Base
|
|||||||
|
|
||||||
scope :admins, ->{ where(admin: true) }
|
scope :admins, ->{ where(admin: true) }
|
||||||
scope :moderators, ->{ where(moderator: true) }
|
scope :moderators, ->{ where(moderator: true) }
|
||||||
scope :staff, ->{ where("moderator = 't' or admin = 't'") }
|
scope :staff, ->{ where("moderator or admin ") }
|
||||||
|
|
||||||
module NewTopicDuration
|
module NewTopicDuration
|
||||||
ALWAYS = -1
|
ALWAYS = -1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user