Skip to content

Commit

Permalink
adds super_admin to spree_roles
Browse files Browse the repository at this point in the history
  • Loading branch information
jsqu99 committed Feb 3, 2013
1 parent b1dc644 commit 9653b86
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/spree/user_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ def super_admin_exists?

def ensure_at_least_one_super_admin_exists
unless super_admin_exists?
super_admin_role = Spree::Role.find_or_create_by_name 'super_admin'
self.spree_roles << super_admin_role
self.super_admin = true
end
end
Expand Down

0 comments on commit 9653b86

Please sign in to comment.