@@ -65,7 +65,7 @@ pub fn generate_model(model: &AnalyzedModel, config: &MacroConfig) -> TokenStrea
6565 impl #impl_generics #rorm_path:: model:: Model for #ident #type_generics #where_clause {
6666 type Primary = #primary_struct #type_generics;
6767
68- type Fields <P : #rorm_path :: internal :: relation_path :: Path > = #fields_struct_ident #type_generics_with_path;
68+ type Fields <P : ' static > = #fields_struct_ident #type_generics_with_path;
6969
7070 const TABLE : & ' static str = #table;
7171 const SOURCE : #rorm_path:: internal:: hmr:: Source = #source;
@@ -326,12 +326,13 @@ fn generate_fields_struct(model: &AnalyzedModel, config: &MacroConfig) -> (Ident
326326 } ) ;
327327 let fields_ident_1 = model. fields . iter ( ) . map ( |field| & field. ident ) ;
328328 let fields_ident_2 = fields_ident_1. clone ( ) ;
329- let fields_type = model. fields . iter ( ) . map ( |field| & field. unit ) ;
329+ let fields_type = model. fields . iter ( ) . map ( |field| & field. ty ) ;
330+ let fields_unit = model. fields . iter ( ) . map ( |field| & field. unit ) ;
330331
331332 let mut generics = model. experimental_generics . clone ( ) ;
332- generics. params . push ( GenericParam :: Type (
333- syn :: parse_quote! ( Path : #rorm_path :: internal :: relation_path :: Path ) ,
334- ) ) ;
333+ generics
334+ . params
335+ . push ( GenericParam :: Type ( syn :: parse_quote! ( Path : ' static ) ) ) ;
335336 let ( impl_generics_with_path, type_generics_with_path, _) = generics. split_for_impl ( ) ;
336337 let ( _, type_generics, where_clause) = model. experimental_generics . split_for_impl ( ) ;
337338
@@ -341,7 +342,11 @@ fn generate_fields_struct(model: &AnalyzedModel, config: &MacroConfig) -> (Ident
341342 #vis struct #ident #impl_generics_with_path #where_clause {
342343 #(
343344 #[ doc = #fields_doc]
344- #fields_vis #fields_ident_1: #rorm_path:: fields:: proxy:: FieldProxy <( #fields_type #type_generics, Path ) >,
345+ #fields_vis #fields_ident_1: #rorm_path:: fields:: proxy:: FieldProxy <(
346+ #fields_unit #type_generics,
347+ Path ,
348+ <#fields_type #type_generics as #rorm_path:: fields:: traits:: FieldType >:: FieldProxyLayers ,
349+ ) >,
345350 ) *
346351 }
347352 impl #impl_generics_with_path #rorm_path:: internal:: ConstRef for #ident #type_generics_with_path #where_clause {
0 commit comments