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

Purpose / How to configure to use existing model #13

Open
timdiggins opened this issue Sep 13, 2018 · 2 comments
Open

Purpose / How to configure to use existing model #13

timdiggins opened this issue Sep 13, 2018 · 2 comments

Comments

@timdiggins
Copy link

timdiggins commented Sep 13, 2018

I've been using trestle happily with my own hand-rolled auth (basically doing Trestle::ApplicationController.send(:include, MyAuthConcern in a Trestle.configure block).

However I wanted to add trestle-sidekiq to the mix and it requires trestle-auth.

I was surprised that the generator for trestle-auth just made a model -- I thought it might just generate an initializer (a la Devise).

Is the purpose of Trestle Auth just to provide a model etc, or to be more of a generic framework for auth ?

I'm happy to contribute, but not at all sure how yet.

@spohlenz
Copy link
Member

The generator for trestle-auth both generates a default model as well as injects (mostly commented) configuration code into an existing config/initializers/trestle.rb.

If you are using an existing model, then you should be able to delete the generated model & migration, and customize the configuration variables and blocks to suit your own model. If you find that the existing hooks are too limited for your use case, please open an issue (or PR) and we'll see how it can best be resolved.

@timdiggins
Copy link
Author

Thank you (so quick too!). I've can see the modifications to the initializer now (I had to remove some of my code from config/initializers/trestle.rb so didn't spot that the file had also been modified by the generator).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants