diff options
author | Yves Senn <yves.senn@gmail.com> | 2014-08-27 12:30:35 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2014-08-27 12:30:35 +0200 |
commit | b9b521306c47d65bdbe18ec31a7b784adbfd1849 (patch) | |
tree | ef81fbcc10606fbfae875560ae5c0c8f78c7b88b /railties/lib/rails/generators | |
parent | 20e7f08ecc22983183909ec60771b929a4c2af16 (diff) | |
download | rails-b9b521306c47d65bdbe18ec31a7b784adbfd1849.tar.gz rails-b9b521306c47d65bdbe18ec31a7b784adbfd1849.tar.bz2 rails-b9b521306c47d65bdbe18ec31a7b784adbfd1849.zip |
fix broken `gem` method with non-String arguments. Closes #16709.
This was caused by #15327.
Diffstat (limited to 'railties/lib/rails/generators')
-rw-r--r-- | railties/lib/rails/generators/actions.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/railties/lib/rails/generators/actions.rb b/railties/lib/rails/generators/actions.rb index 4709914947..b2c9d12996 100644 --- a/railties/lib/rails/generators/actions.rb +++ b/railties/lib/rails/generators/actions.rb @@ -268,11 +268,13 @@ module Rails # Surround string with single quotes if there is no quotes. # Otherwise fall back to double quotes - def quote(str) - if str.include?("'") - str.inspect + def quote(value) + return value.inspect unless value.is_a? String + + if value.include?("'") + value.inspect else - "'#{str}'" + "'#{value}'" end end end |