automatic groups should be bootstrapped

This commit is contained in:
Sam 2013-11-18 12:53:14 +11:00
parent 805feca5f2
commit 6e1198334c
2 changed files with 7 additions and 0 deletions

View File

@ -89,6 +89,12 @@ class Group < ActiveRecord::Base
end
end
def self.ensure_automatic_groups!
AUTO_GROUPS.keys.each do |name|
refresh_automatic_group!(name) unless lookup_group(name)
end
end
def self.[](name)
lookup_group(name) || refresh_automatic_group!(name)
end

1
db/fixtures/groups.rb Normal file
View File

@ -0,0 +1 @@
Group.ensure_automatic_groups!