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

Fix for usage with a beta or rc version of rails #308

Closed
wants to merge 1 commit into from

Conversation

colinux
Copy link

@colinux colinux commented Feb 24, 2015

For beta/rc versions of Rails, find_by_name does not return the rails gem. By using the less strict find_all_by_name method, this allows using i18n-js with versions of rails like 4.2.1.rc1.

For beta/rc versions of Rails, find_by_name does not return the rails gem. By using the less strict find_all_by_name method, this allows using i18n-js with versions of rails like "4.2.1.rc1".
@PikachuEXE
Copy link

The code can already detect beta/rc versions of rails gem
try I18n::JS::Dependencies.send(:safe_gem_check, "rails", "~> 4.0", ">= 4.0.0.beta1") with 4.2.1.rc1 installed

@colinux
Copy link
Author

colinux commented Feb 26, 2015

Hello,

if I replace the line 10 (method rails4?) with safe_gem_check("rails", "~> 4", ">= 4.0.0.beta1") && running_rails4?, it doesn't work neither, the rcX are not detected. Same result with safe_gem_check("rails", "~> 4", ">= 4.0.0.beta1", ">= 4.0.0.rc1").

@PikachuEXE
Copy link

Gem::Specification.find_by_name("rails", "~> 4.0", ">= 4.0.0.beta1")? I can confirm this works and detects rails 4.2.1.rc1.
If this still doesn't work try changing the arguments passed inside and report back what works for you.
You can try Gem::Specification.find_all_by_name("rails", "~> 4.0", ">= 4.0.0.beta1") first.

@colinux
Copy link
Author

colinux commented Feb 26, 2015

Oooh I just have realized I run i18n-js in 3.0.0.rc8 version, not the master. The master code works perfectly well without any change, you are right. Sorry for the waste of time !

@colinux colinux closed this Feb 26, 2015
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