Closed zimt28 closed 8 years ago
The main reason for using keyword arguments, instead of the config, is that it allows the developer the freedom to use different values in different parts of the app. As it is now, if the developer can use a different db_module, or unique_id, in a part of the app.
I see, but often times this won't change. It would be great to allow a custom default value, which can be overwritten using the current syntax.
This way people who have one db_module
and unique_id
could get cleaner code, those who have more could still choose every time they use Openmaize's plugs.
In the latest version - updated earlier today - db_module
defaults to the name generated by openmaize.gen.ectodb
, that is, MyApp.OpenmaizeEcto, so for most people there should be no need to set it directly.
unique_id
defaults to username
.
You can see how the changes are used in the example app.
It would be nice if we could add the
db_module
to the config once, instead of adding it to every plug etc.Is there any reason against it?
Edit: Same for
unique_id