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

Add namespace option to create nested constants #26

Closed
wants to merge 1 commit into from
Closed

Add namespace option to create nested constants #26

wants to merge 1 commit into from

Conversation

palkan
Copy link
Contributor

@palkan palkan commented Aug 2, 2016

Make possible creation of namespaced models:

with_model :TestUser, namespace: Users, superclass: User

with_model :Test, namespace: MyModule, superclass: MyModule::Base

@amarshall
Copy link
Contributor

Does with_model :"A::B" not work?

@amarshall
Copy link
Contributor

Actually…it won’t. But for the same reason this P.R. won’t if the namespace isn’t already defined. (I think…it’s early—I’ll look into this further later.)

@amarshall
Copy link
Contributor

This has been implemented in aa788c0. Will make a release sometime soon. I’ve implemented this a bit differently than your P.R.; instead, just provide the namespace in the name (e.g. with_model :'Foo::Bar'). The namespace does still need to already exist (with_model will not create it, as that feels, to me, overreaching). I think this API is perhaps a bit more intuitive than a separate option.

Sorry it took so long to get this feature in!

@amarshall amarshall closed this Aug 23, 2018
@amarshall
Copy link
Contributor

@palkan This is now in v2.1.0.

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

Successfully merging this pull request may close these issues.

None yet

2 participants