fixes #2417
This commit is contained in:
13
script/fixes/033_enable_can_approve_posts_flag.rb
Normal file
13
script/fixes/033_enable_can_approve_posts_flag.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment'))
|
||||
|
||||
ActiveRecord::Base.connection.execute("set statement_timeout = 0")
|
||||
|
||||
CurrentUser.user = User.admins.first
|
||||
CurrentUser.ip_addr = "127.0.0.1"
|
||||
|
||||
User.where("level >= ?", User::Levels::JANITOR).find_each do |user|
|
||||
user.can_approve_posts = true
|
||||
user.save
|
||||
end
|
||||
Reference in New Issue
Block a user