To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / db / migrate / 062_insert_builtin_roles.rb @ 1298:4f746d8966dd

History | View | Annotate | Download (431 Bytes)

1
class InsertBuiltinRoles < ActiveRecord::Migration
2
  def self.up
3
    Role.reset_column_information
4
    nonmember = Role.new(:name => 'Non member', :position => 0)
5
    nonmember.builtin = Role::BUILTIN_NON_MEMBER
6
    nonmember.save
7

    
8
    anonymous = Role.new(:name => 'Anonymous', :position => 0)
9
    anonymous.builtin = Role::BUILTIN_ANONYMOUS
10
    anonymous.save
11
  end
12

    
13
  def self.down
14
    Role.destroy_all 'builtin <> 0'
15
  end
16
end