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

Rails::VERSION is more accurate check for presence of Rails #625

Merged
merged 1 commit into from
Feb 3, 2018

Conversation

nattfodd
Copy link
Contributor

@nattfodd nattfodd commented Jan 12, 2018

Rails module can be defined without actual Rails gem.

I work on a Sinatra project, which has ActionView in dependencies. ActionView itself does not depend on Rails, but it has rails-html-sanitizer and rails-dom-testing gems in dependencies, which both define Rails module.

Therefore, check defined?(Rails) isn't fully valid, and requires hacking on the client app side to make it work (i.e. defining Rails.root method and having config/chewy.yml file)

@nattfodd
Copy link
Contributor Author

nattfodd commented Jan 12, 2018

Can someone check if those failing tests on CI are PR related, or those are floating specs? I ran those tests locally and they passed...

@nattfodd nattfodd force-pushed the rails_dependency_fixed branch 3 times, most recently from 29c75f1 to 8a79c2c Compare January 16, 2018 08:01
@nattfodd
Copy link
Contributor Author

nattfodd commented Jan 16, 2018

Ok, I've investigated failing test case - it's definitely not related to the fix itself. It seems it's something about race condition here https://github.com/toptal/chewy/blob/master/spec/chewy/index/actions_spec.rb#L501-L521

@pyromaniac
Copy link
Contributor

Thanks for the contribution!

@nattfodd nattfodd deleted the rails_dependency_fixed branch February 3, 2018 08:59
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.

2 participants