You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

062_insert_builtin_roles.rb 443B

12345678910111213141516
  1. class InsertBuiltinRoles < ActiveRecord::Migration[4.2]
  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. anonymous = Role.new(:name => 'Anonymous', :position => 0)
  8. anonymous.builtin = Role::BUILTIN_ANONYMOUS
  9. anonymous.save
  10. end
  11. def self.down
  12. Role.where('builtin <> 0').destroy_all
  13. end
  14. end