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