Skip to content

Commit

Permalink
Merge pull request #5 from keithamus/upgrade-to-sea-orm-0-12-and-fix-…
Browse files Browse the repository at this point in the history
…code

upgrade to sea-orm 0.12 and fix code
  • Loading branch information
mgugger authored Aug 24, 2023
2 parents 3dcc17b + 81cb448 commit defe9cd
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ chrono = "0.4.26"
tera = "^1.19.0"
async-trait = "^0.1.68"
lazy_static = "^1.4.0"
itertools = "^0.10.5"
itertools = "^0.11.0"
serde = "^1.0.164"
serde_derive = "^1.0.164"
sea-orm = { version = "^0.11.3", features = [], default-features = false }
sea-orm = { version = "^0.12.2", features = [], default-features = false }
actix-admin-macros = { version = "0.5.0", path = "actix_admin_macros" }
derive_more = "0.99.17"
regex = "1.8.4"
urlencoding = "2.1.2"

[dev-dependencies]
sea-orm = { version = "^0.11.3", features = [ "sqlx-sqlite", "runtime-actix-native-tls", "macros" ], default-features = true }
sea-orm = { version = "^0.12.2", features = [ "sqlx-sqlite", "runtime-actix-native-tls", "macros" ], default-features = true }
actix-rt = "2.8.0"
azure_auth = { path = "./examples/azure_auth/azure_auth" }
oauth2 = "4.4.1"
dotenv = "0.15"
actix-session = { version = "0.7.2", features = ["cookie-session"] }
actix-session = { version = "0.7.2", features = ["cookie-session"] }
2 changes: 1 addition & 1 deletion actix_admin_macros/src/struct_fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ pub fn get_actix_admin_fields_searchable(fields: &Vec<ModelField>) -> Vec<TokenS
let column_name = capitalize_first_letter(&model_field.ident.to_string());
let column_ident = Ident::new(&column_name, Span::call_site());
quote! {
.add(Column::#column_ident.contains(&search))
.add(Column::#column_ident.contains(search))
}
})
.collect::<Vec<_>>()
Expand Down
4 changes: 2 additions & 2 deletions examples/azure_auth/entity/post.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl Related<super::comment::Entity> for Entity {

impl ActiveModelBehavior for ActiveModel {}

#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Deserialize, Serialize, DeriveActixAdminEnumSelectList)]
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveDisplay, DeriveActiveEnum, Deserialize, Serialize, DeriveActixAdminEnumSelectList)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "tea")]
pub enum Tea {
#[sea_orm(string_value = "EverydayTea")]
Expand All @@ -69,4 +69,4 @@ impl FromStr for Tea {

impl ActixAdminModelValidationTrait<ActiveModel> for Entity {}

impl ActixAdminModelFilterTrait<Entity> for Entity {}
impl ActixAdminModelFilterTrait<Entity> for Entity {}
4 changes: 2 additions & 2 deletions examples/basic/entity/post.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl Related<super::comment::Entity> for Entity {

impl ActiveModelBehavior for ActiveModel {}

#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Deserialize, Serialize, DeriveActixAdminEnumSelectList)]
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveDisplay, DeriveActiveEnum, Deserialize, Serialize, DeriveActixAdminEnumSelectList)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "tea")]
pub enum Tea {
#[sea_orm(string_value = "EverydayTea")]
Expand All @@ -74,4 +74,4 @@ impl FromStr for Tea {

impl ActixAdminModelValidationTrait<ActiveModel> for Entity {}

impl ActixAdminModelFilterTrait<Entity> for Entity {}
impl ActixAdminModelFilterTrait<Entity> for Entity {}
2 changes: 1 addition & 1 deletion src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,4 +398,4 @@ impl ActixAdminBuilderTrait for ActixAdminBuilder {
fn get_actix_admin(&self) -> ActixAdmin {
self.actix_admin.clone()
}
}
}
4 changes: 2 additions & 2 deletions tests/test_setup/post.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl Related<super::comment::Entity> for Entity {

impl ActiveModelBehavior for ActiveModel {}

#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Deserialize, Serialize, DeriveActixAdminEnumSelectList)]
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveDisplay, DeriveActiveEnum, Deserialize, Serialize, DeriveActixAdminEnumSelectList)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "tea")]
pub enum Tea {
#[sea_orm(string_value = "EverydayTea")]
Expand All @@ -69,4 +69,4 @@ impl FromStr for Tea {

impl ActixAdminModelValidationTrait<ActiveModel> for Entity {}

impl ActixAdminModelFilterTrait<Entity> for Entity {}
impl ActixAdminModelFilterTrait<Entity> for Entity {}

0 comments on commit defe9cd

Please sign in to comment.