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

Reloading padrino 0.12.2 causes dm-types to lose the UUIDTools::UUID constant #1722

Closed
postmodern opened this issue Jul 18, 2014 · 8 comments · Fixed by #1723
Closed

Reloading padrino 0.12.2 causes dm-types to lose the UUIDTools::UUID constant #1722

postmodern opened this issue Jul 18, 2014 · 8 comments · Fixed by #1723
Assignees
Labels

Comments

@postmodern
Copy link
Contributor

I noticed while using padrino 0.12.2 with DataMapper, models that used the UUID property would cause dm-types to raise a NameError for UUIDTools::UUID when the app reloaded. This does not seem to occur in padrino 0.11.1.

@ujifgc
Copy link
Member

ujifgc commented Jul 18, 2014

Confirmed. It can be temporarily fixed by require 'uuidtools' in your config/boot.rb.

@ujifgc
Copy link
Member

ujifgc commented Jul 19, 2014

Closing in favor of #1723

@ujifgc ujifgc closed this as completed Jul 19, 2014
ujifgc added a commit that referenced this issue Jul 21, 2014
do not remove external constants, fixes #1722
@postmodern
Copy link
Contributor Author

@ujifgc interesting. I thought Bundle.require would require uuidtools?

@ujifgc ujifgc removed the bug label Jul 23, 2014
@ujifgc ujifgc reopened this Jul 23, 2014
@ujifgc
Copy link
Member

ujifgc commented Jul 23, 2014

I will investigate further.

@ujifgc
Copy link
Member

ujifgc commented Jul 24, 2014

It only requires uuidtools/version on Bundler.require. The actual uuidtools gets required by autoloaded dm-types/uuid.

@ujifgc ujifgc closed this as completed Jul 24, 2014
@postmodern
Copy link
Contributor Author

Ah ha! I also ran into the same problem with JSON. Requiring the dm-types/ file fixed it.

@postmodern
Copy link
Contributor Author

Also just realized that dm-types uses autoload to require the constants. https://github.com/datamapper/dm-types/blob/master/lib/dm-types.rb Is padrino's reloader incompatible with autoload?

@ujifgc
Copy link
Member

ujifgc commented Jul 27, 2014

Do you encounter any problems with autoloaded constants after b3a6eb5?

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

Successfully merging a pull request may close this issue.

2 participants