diff --git a/app/models/guest_user.rb b/app/models/guest_user.rb new file mode 100644 index 0000000..79950bd --- /dev/null +++ b/app/models/guest_user.rb @@ -0,0 +1,9 @@ +class GuestUser + def admin? + false + end + + def moderator? + false + end +end diff --git a/app/models/user.rb b/app/models/user.rb index 458c5c9..00834d1 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,7 +1,7 @@ class User < ActiveRecord::Base rolify - after_create :set_admin, if: User.count == 1 + after_create :set_admin, if: Proc.new { User.count == 1 } def self.create_with_omniauth(auth) where(provider: auth[:provider], uid: auth[:uid]).first_or_create do |user| @@ -26,13 +26,3 @@ class User < ActiveRecord::Base self.add_role :admin end end - -class GuestUser - def admin? - false - end - - def moderator? - false - end -end