struct

CrystalCommunity::DB::User

Inherits DB::Mappable / DB::Serializable / Struct / Value / Object

Constructors

create

Create a new user

Source

Class methods

all

Get all users

Source
count

Count total users

Source
find(id : Int64) : User | Nil

Find user by ID

Source
find_by_github_id(github_id : String) : User | Nil

Find user by GitHub ID

Source
find_by_github_username(username : String) : User | Nil

Find user by GitHub username

Source
from_rs(rs : ::DB::ResultSet)
Source
needing_geocode

Users that have location set but missing latitude/longitude (for backfill)

Source
update_coordinates(id : Int64, latitude : Float64 | Nil, longitude : Float64 | Nil) : User | Nil

Update only latitude and longitude (e.g. after geocoding)

Source
update_from_github(id : Int64, name : String | Nil, bio : String | Nil, location : String | Nil, avatar_url : String | Nil) : User | Nil

Update user from GitHub data

Source

Instance methods

admin?

Check if user is admin

Source
avatar_url
Source
avatar_url=(avatar_url : String | Nil)
Source
bio=(bio : String | Nil)
Source
comments_count
Source
comments_count=(comments_count : Int32)
Source
created_at
Source
created_at=(created_at : Time | Nil)
Source
developer?

Check if user is developer

Source
github_id
Source
github_id=(github_id : String)
Source
github_username
Source
github_username=(github_username : String)
Source
id=(id : Int64 | Nil)
Source
latitude
Source
latitude=(latitude : Float64 | Nil)
Source
location
Source
location=(location : String | Nil)
Source
longitude
Source
longitude=(longitude : Float64 | Nil)
Source
name
Source
name=(name : String | Nil)
Source
open_to_work
Source
open_to_work=(open_to_work : Bool)
Source
posts_count
Source
posts_count=(posts_count : Int32)
Source
projects_count
Source
projects_count=(projects_count : Int32)
Source
role
Source
role=(role : String)
Source
score
Source
score=(score : Int32)
Source
stars_count
Source
stars_count=(stars_count : Int32)
Source
updated_at
Source
updated_at=(updated_at : Time | Nil)
Source