socialforge/db/migrate/20140708023356_add_authorit...

14 lines
338 B
Ruby
Raw Normal View History

2014-07-08 18:02:10 +08:00
class AddAuthority < ActiveRecord::Migration
def change
# 添加课程权限
Role.all.each do |role|
if role.name == '学生'
role.permissions.append(:paret_in_homework)
elsif role.name == 'Manager'
role.permissions.append(:is_manager)
end
role.save(:validate => false)
end
end
end