2007-08-29 18:52:35 +02:00
|
|
|
class InsertBuiltinRoles < ActiveRecord::Migration
|
|
|
|
def self.up
|
2012-02-25 12:48:29 +01:00
|
|
|
Role.reset_column_information
|
2007-08-29 18:52:35 +02:00
|
|
|
nonmember = Role.new(:name => 'Non member', :position => 0)
|
|
|
|
nonmember.builtin = Role::BUILTIN_NON_MEMBER
|
|
|
|
nonmember.save
|
2011-11-08 06:10:41 +01:00
|
|
|
|
2007-08-29 18:52:35 +02:00
|
|
|
anonymous = Role.new(:name => 'Anonymous', :position => 0)
|
|
|
|
anonymous.builtin = Role::BUILTIN_ANONYMOUS
|
2011-11-08 06:10:41 +01:00
|
|
|
anonymous.save
|
2007-08-29 18:52:35 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.down
|
2016-07-16 12:31:56 +02:00
|
|
|
Role.where('builtin <> 0').destroy_all
|
2007-08-29 18:52:35 +02:00
|
|
|
end
|
|
|
|
end
|