Merge pull request #16954 from geoffharcourt/inject-over-sum

Use #inject over #sum to build PG create DB statement
This commit is contained in:
Rafael Mendonça França 2014-09-18 15:29:26 -03:00
commit 25f5af7f3f
1 changed files with 2 additions and 2 deletions

View File

@ -60,8 +60,8 @@ module ActiveRecord
def create_database(name, options = {})
options = { encoding: 'utf8' }.merge!(options.symbolize_keys)
option_string = options.sum do |key, value|
case key
option_string = options.inject("") do |memo, (key, value)|
memo += case key
when :owner
" OWNER = \"#{value}\""
when :template