diff options
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20140920094058_insert_builtin_groups.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/db/migrate/20140920094058_insert_builtin_groups.rb b/db/migrate/20140920094058_insert_builtin_groups.rb new file mode 100644 index 000000000..ec505af2f --- /dev/null +++ b/db/migrate/20140920094058_insert_builtin_groups.rb @@ -0,0 +1,21 @@ +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 |