From 44a5da837d1bd539f74924b1b002bb308b99ae9f Mon Sep 17 00:00:00 2001 From: edikle Date: Wed, 31 Jan 2018 16:19:42 +0800 Subject: [PATCH] add is_admin? method --- app/models/user.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 379658a..f3f2d9f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,2 +1,7 @@ class User < ApplicationRecord -end + + def is_admin? + self.id == 1 + end + +end \ No newline at end of file