Page MenuHomeGRNET

20180726141603_add_admin_to_users.rb
No OneTemporary

File Metadata

Created
Fri, Aug 29, 9:32 PM

20180726141603_add_admin_to_users.rb

class AddAdminToUsers < ActiveRecord::Migration
def change
add_column :users, :admin, :boolean
User.find_each do |u|
u.admin = u.groups.where(name: WebDNS.settings[:admin_group]).exists?
u.save
end
end
end

Event Timeline