Sha256: 758df422f75aeea7cb6eac7e127f0306c6fee20f07308f9a5fba3d52f3aac2e9

Contents?: true

Size: 488 Bytes

Versions: 34

Compression:

Stored size: 488 Bytes

Contents

class InsertBuiltinGroups < ActiveRecord::Migration
  def up
    Group.reset_column_information

    unless GroupAnonymous.any?
      g = GroupAnonymous.new(:lastname => 'Anonymous users')
      g.status = 1
      g.save :validate => false
    end
    unless GroupNonMember.any?
      g = GroupNonMember.new(:lastname => 'Non member users')
      g.status = 1
      g.save :validate => false
    end
  end

  def down
    GroupAnonymous.delete_all
    GroupNonMember.delete_all
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
redmine_extensions-0.0.23 spec/redmine/db/migrate/20140920094058_insert_builtin_groups.rb
redmine_extensions-0.0.22 spec/redmine/db/migrate/20140920094058_insert_builtin_groups.rb
redmine_extensions-0.0.21 spec/redmine/db/migrate/20140920094058_insert_builtin_groups.rb
redmine_extensions-0.0.20 spec/redmine/db/migrate/20140920094058_insert_builtin_groups.rb
redmine_extensions-0.0.19 spec/redmine/db/migrate/20140920094058_insert_builtin_groups.rb
redmine_extensions-0.0.18 spec/redmine/db/migrate/20140920094058_insert_builtin_groups.rb
redmine_extensions-0.0.17 spec/redmine/db/migrate/20140920094058_insert_builtin_groups.rb
redmine_extensions-0.0.16 spec/redmine/db/migrate/20140920094058_insert_builtin_groups.rb
redmine_extensions-0.0.15 spec/redmine/db/migrate/20140920094058_insert_builtin_groups.rb
redmine_extensions-0.0.14 spec/redmine/db/migrate/20140920094058_insert_builtin_groups.rb
redmine_extensions-0.0.13 spec/redmine/db/migrate/20140920094058_insert_builtin_groups.rb
redmine_extensions-0.0.12 spec/redmine/db/migrate/20140920094058_insert_builtin_groups.rb
redmine_extensions-0.0.10 spec/redmine/db/migrate/20140920094058_insert_builtin_groups.rb
redmine_extensions-0.0.8 spec/redmine/db/migrate/20140920094058_insert_builtin_groups.rb