Skip to content

Commit

Permalink
bugfix: intends to use shared aggregators is non-nullable (#547)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbr authored Oct 4, 2023
1 parent e9d84cf commit 04222fc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/entity/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub struct Model {

pub admin: bool,

pub intends_to_use_shared_aggregators: Option<bool>,
pub intends_to_use_shared_aggregators: bool,
}

impl Entity {
Expand Down Expand Up @@ -108,7 +108,7 @@ impl NewAccount {
created_at: OffsetDateTime::now_utc(),
updated_at: OffsetDateTime::now_utc(),
admin: false,
intends_to_use_shared_aggregators: None,
intends_to_use_shared_aggregators: false,
}
.into_active_model())
}
Expand All @@ -128,7 +128,7 @@ impl UpdateAccount {
am.name = self.name.map_or(ActiveValue::NotSet, ActiveValue::Set);
am.intends_to_use_shared_aggregators = self
.intends_to_use_shared_aggregators
.map_or(ActiveValue::NotSet, |b| ActiveValue::Set(Some(b)));
.map_or(ActiveValue::NotSet, ActiveValue::Set);
if am.is_changed() {
am.updated_at = ActiveValue::Set(OffsetDateTime::now_utc());
}
Expand Down

0 comments on commit 04222fc

Please sign in to comment.