Skip to main content

Module naming

Module naming 

Source
Expand description

Turning one name the user typed into every name the generator needs.

luxid make:model User has to produce user.rs, users, UsersController, users_controller.rs, StoreUser, and a handful more. Getting these consistent is most of what makes generated code feel like it belongs.

Structs§

Names
Every spelling of a model name.

Functions§

pluralize
The inverse of the singularisation #[derive(Model)] performs, and just as deliberately simple. Irregular nouns are the user’s to override.
to_pascal
user_profile → UserProfile.
to_snake
UserProfile / userProfile / user_profile → user_profile.