collab: Clean up LLM token creation (#26955)
This PR cleans up the LLM token creation a bit. We now pass in the entire list of feature flags to the `LlmTokenClaims::create` method to prevent having a bunch of confusable `bool` parameters. Release Notes: - N/A
This commit is contained in:
parent
2b2b9c1624
commit
1397e01735
3 changed files with 26 additions and 14 deletions
|
@ -43,6 +43,20 @@ pub enum Relation {
|
|||
Contributor,
|
||||
}
|
||||
|
||||
impl Model {
|
||||
/// Returns the timestamp of when the user's account was created.
|
||||
///
|
||||
/// This will be the earlier of the `created_at` and `github_user_created_at` timestamps.
|
||||
pub fn account_created_at(&self) -> NaiveDateTime {
|
||||
let mut account_created_at = self.created_at;
|
||||
if let Some(github_created_at) = self.github_user_created_at {
|
||||
account_created_at = account_created_at.min(github_created_at);
|
||||
}
|
||||
|
||||
account_created_at
|
||||
}
|
||||
}
|
||||
|
||||
impl Related<super::access_token::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::AccessToken.def()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue