Skip to content

Commit 869b2d0

Browse files
committed
removed weird concern and fixed scope
1 parent 318188c commit 869b2d0

File tree

2 files changed

+2
-26
lines changed

2 files changed

+2
-26
lines changed

app/models/concerns/user_wtf.rb

Lines changed: 0 additions & 21 deletions
This file was deleted.

app/models/user.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,7 @@ class User < ActiveRecord::Base
121121
include UserStatistics
122122
include UserTwitter
123123

124-
# TODO kill
125-
include UserWtf
126-
127-
attr_protected :admin, :id, :github_id, :twitter_id, :linkedin_id, :api_key
124+
attr_protected :admin, :role, :id, :github_id, :twitter_id, :linkedin_id, :api_key
128125

129126
mount_uploader :avatar, AvatarUploader
130127
mount_uploader :resume, ResumeUploader
@@ -220,7 +217,7 @@ def near
220217
filter = "#{filter.upcase}%"
221218
where("upper(username) LIKE ? OR upper(twitter) LIKE ? OR upper(github) LIKE ? OR upper(name) LIKE ?", filter, filter, filter, "%#{filter}").order("name ASC")
222219
}
223-
scope :admins, -> { where(admin: true) }
220+
scope :admins, -> { where(role: 'admin') }
224221
scope :active, -> { where(state: ACTIVE) }
225222
scope :pending, -> { where(state: PENDING) }
226223
scope :abandoned, -> { where(state: 'registration').where('created_at < ?', 1.hour.ago) }

0 commit comments

Comments
 (0)