Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guide to overwrite Gravatar when using an extended user model #34

Open
wants to merge 1 commit into
base: 5.0
Choose a base branch
from
Open

Guide to overwrite Gravatar when using an extended user model #34

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Aug 20, 2017

added a small section on overriding gravatar when using an extended user model.

added a small section on overriding gravatar when using an extended user model.
@alexweissman
Copy link
Member

I'm not sure if this is the appropriate section to include this in - what do you think about putting this in its own recipe and then fleshing it out a little more?

@ghost
Copy link
Author

ghost commented Aug 24, 2017

probably not the best section - but it took me a little while to figure out, and will be helpful for anyone searching the docs for "avatar". The best option would be to write a full recipe/sprinkle for avatar integration, but I'm pretty swamped right now. The other problem with avatars is that everyone will have different storage - I use S3, but many folks will want to store locally, and probably some people will want to store in the database -_-. happy for you to not merge it, but i think it should be at least mentioned you need to override the default behaviour if you have a new db field called avatar.

@alexweissman
Copy link
Member

everyone will have different storage - I use S3, but many folks will want to store locally, and probably some people will want to store in the database

So, the simple solution to this is to abstract out the persistence layer. Take a look at, for example, how the "remember me" library does this kind of abstraction: https://github.com/gbirke/rememberme/tree/master/src/Storage

Every storage (persistence) driver implements the StorageInterface interface. Classes that need to interact with the storage layer can work with any implementation of StorageInterface, without worrying about the details of how the particular storage driver works.

@lcharette lcharette changed the title Update docs.md Guide to overwrite Gravatar when using an extended user model May 25, 2019
@lcharette lcharette added the New guide request New guide, section or recipe label May 25, 2019
@lcharette lcharette changed the base branch from develop to 5.0 November 12, 2023 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New guide request New guide, section or recipe
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants