From 15f51dbf8c19d1072d873c3b92b5a638035728a1 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 25 Sep 2016 14:20:29 +0200 Subject: Better styling for selected status in detailed view --- app/models/user.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/models') diff --git a/app/models/user.rb b/app/models/user.rb index 066e376f4..d4361ffa1 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -10,7 +10,8 @@ class User < ApplicationRecord scope :prolific, -> { joins('inner join statuses on statuses.account_id = users.account_id').select('users.*, count(statuses.id) as statuses_count').group('users.id').order('statuses_count desc') } scope :recent, -> { order('created_at desc') } - + scope :admins, -> { where(admin: true) } + def admin? self.admin end -- cgit