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

Allow toggling extra features #41

Open
krainboltgreene opened this issue Jul 2, 2018 · 4 comments
Open

Allow toggling extra features #41

krainboltgreene opened this issue Jul 2, 2018 · 4 comments

Comments

@krainboltgreene
Copy link

create_view somehow overwrites the scenic gem's version, which is better.

@pjungwir
Copy link
Contributor

pjungwir commented Jul 6, 2018

I agree that it would be nice to use just rein's constraint features. Views don't seem to match the spirit of the gem suggested by the name, and scenic is more full-featured there. @nullobject if you'd like a PR for this I could write something that lets you supply some configuration to enable/disable different bundles of methods, like views, constraints, schemas, and enums, defaulting to everything enabled. Just let me know!

@krainboltgreene
Copy link
Author

krainboltgreene commented Jul 6, 2018 via email

@toydestroyer
Copy link

Hey there, any updates on this?

We've also faced this issue and for now decided to maintain our own fork without views.

How about extracting it to rein-views gem so everyone who wants to keep using it instead of scenic will continue to use it.

Or make rein a metagem like fog and move the actual logic to separate gems rein-constrants, rein-enums etc

@hlascelles
Copy link

Been a couple of years, any further thoughts on this @nullobject? It does hamper using other tools like scenic.

pjungwir added a commit to pjungwir/rein that referenced this issue Aug 30, 2023
Rein's `create_view` function is extremely rudimentary, and it conflicts
with using a more full-featured solution like scenic. Several people
have requested to make this optional, but the author is unwilling
(nullobject#41).

This commit lets you turn off rein's view functions by setting an
envvar. This is not as nice as using an initializer, but that would
require more extensive changes (mostly because rein adds these functions
to `ActiveRecord::Migration` as soon as it gets required, which is
before we have loaded Rails configuration, etc. We could make it work by
turning rein into a Rails plugin/engine, but I don't want to work on
that right now.
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

4 participants