2020-05-24 17:14:26 +00:00
|
|
|
require 'administrate/field/base'
|
|
|
|
|
|
|
|
class AvatarField < Administrate::Field::Base
|
|
|
|
def avatar_url
|
2022-08-31 19:01:43 +00:00
|
|
|
return data.presence if data.presence
|
|
|
|
|
|
|
|
resource.is_a?(User) ? '/assets/administrate/user/avatar.png' : '/assets/administrate/bot/avatar.png'
|
2020-05-24 17:14:26 +00:00
|
|
|
end
|
|
|
|
end
|