<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -13,7 +13,7 @@
 if &amp;cp || exists(&quot;g:autoloaded_rails&quot;)
   finish
 endif
-let g:autoloaded_rails = '3.1'
+let g:autoloaded_rails = '3.2'
 
 let s:cpo_save = &amp;cpo
 set cpo&amp;vim
@@ -84,6 +84,23 @@ function! s:sname()
   return fnamemodify(s:file,':t:r')
 endfunction
 
+function! s:pop_command()
+  if exists(&quot;s:command_stack&quot;) &amp;&amp; len(s:command_stack) &gt; 0
+    exe remove(s:command_stack,-1)
+  endif
+endfunction
+
+function! s:push_chdir()
+  if !exists(&quot;s:command_stack&quot;) | let s:command_stack = [] | endif
+  if exists(&quot;b:rails_root&quot;) &amp;&amp; !s:startswith(getcwd(), rails#app().path())
+    let chdir = exists(&quot;*haslocaldir&quot;) &amp;&amp; haslocaldir() ? &quot;lchdir &quot; : &quot;chdir &quot;
+    call add(s:command_stack,chdir.s:escarg(getcwd()))
+    exe chdir.s:escarg(rails#app().path())
+  else
+    call add(s:command_stack,&quot;&quot;)
+  endif
+endfunction
+
 function! s:app_path(...) dict
   return join([self.root]+a:000,'/')
 endfunction
@@ -402,6 +419,8 @@ function! rails#singularize(word)
   let word = s:sub(word,'ves$','fs')
   let word = s:sub(word,'ss%(es)=$','sss')
   let word = s:sub(word,'s$','')
+  let word = s:sub(word,'%(tatus|lias)\zse$','')
+  let word = s:sub(word,'%(nd|rt)\zsice$','ex')
   return word
 endfunction
 
@@ -411,9 +430,10 @@ function! rails#pluralize(word)
     return word
   endif
   let word = s:sub(word,'[aeio]@&lt;!y$','ie')
+  let word = s:sub(word,'%(nd|rt)@&lt;=ex$','ice')
   let word = s:sub(word,'%([osxz]|[cs]h)$','&amp;e')
   let word = s:sub(word,'f@&lt;!f$','ve')
-  let word .= &quot;s&quot;
+  let word .= 's'
   let word = s:sub(word,'ersons$','eople')
   return word
 endfunction
@@ -658,26 +678,6 @@ function! RailsEval(ruby,...) abort
 endfunction
 
 &quot; }}}1
-&quot; Autocommand Functions {{{1
-
-function! s:QuickFixCmdPre()
-  if exists(&quot;b:rails_root&quot;)
-    if !s:startswith(getcwd(), rails#app().path())
-      let s:last_dir = getcwd()
-      echo &quot;lchdir &quot;.s:escarg(rails#app().path())
-      lchdir `=rails#app().path()`
-    endif
-  endif
-endfunction
-
-function! s:QuickFixCmdPost()
-  if exists(&quot;s:last_dir&quot;)
-    lchdir `=s:last_dir`
-    unlet s:last_dir
-  endif
-endfunction
-
-&quot; }}}1
 &quot; Commands {{{1
 
 function! s:prephelp()
@@ -723,7 +723,7 @@ function! s:BufCommands()
     command! -buffer -bar -nargs=? -bang  Rproject :call s:Project(&lt;bang&gt;0,&lt;q-args&gt;)
   endif
   if exists(&quot;g:loaded_dbext&quot;)
-    command! -buffer -bar -nargs=? -bang  -complete=customlist,s:Complete_environments Rdbext  :call s:BufDatabase(2,&lt;q-args&gt;,&lt;bang&gt;0)
+    command! -buffer -bar -nargs=? -bang  -complete=customlist,s:Complete_environments Rdbext  :call s:BufDatabase(2,&lt;q-args&gt;,&lt;bang&gt;0)|let b:dbext_buffer_defaulted = 1
   endif
   let ext = expand(&quot;%:e&quot;)
   if ext =~ s:viewspattern()
@@ -882,8 +882,12 @@ endfunction
 
 function! s:app_rake_tasks() dict
   if self.cache.needs('rake_tasks')
-    let rakefile = s:rquote(self.path(&quot;Rakefile&quot;))
-    let lines = split(system(&quot;rake -T -f &quot;.rakefile),&quot;\n&quot;)
+    call s:push_chdir()
+    try
+      let lines = split(system(&quot;rake -T&quot;),&quot;\n&quot;)
+    finally
+      call s:pop_command()
+    endtry
     if v:shell_error != 0
       return []
     endif
@@ -995,9 +999,9 @@ function! s:Rake(bang,lnum,arg)
   let withrubyargs = '-r ./config/boot -r '.s:rquote(self.path('config/environment')).' -e &quot;puts \%((in \#{Dir.getwd}))&quot; '
   if arg =~# '^\%(stats\|routes\|secret\|notes\|db:\%(charset\|collation\|fixtures:identify\|version\)\)\%(:\|$\)'
     &quot; So you can see the output even with an inadequate redirect
-    call s:QuickFixCmdPre()
+    call s:push_chdir()
     exe &quot;!&quot;.&amp;makeprg.&quot; &quot;.arg
-    call s:QuickFixCmdPost()
+    call s:pop_command()
   elseif arg =~ '^preview\&gt;'
     exe (lnum == 0 ? '' : lnum).'R'.s:gsub(arg,':','/')
   elseif arg =~ '^runner:'
@@ -1026,13 +1030,13 @@ function! s:Rake(bang,lnum,arg)
   elseif arg != ''
     exe 'make '.arg
   elseif t =~ '^config-routes\&gt;'
-    call s:QuickFixCmdPre()
+    call s:push_chdir()
     exe &quot;!&quot;.&amp;makeprg.&quot; routes&quot;
-    call s:QuickFixCmdPost()
+    call s:pop_command()
   elseif t =~ '^fixtures-yaml\&gt;' &amp;&amp; lnum
-    call s:QuickFixCmdPre()
+    call s:push_chdir()
     exe &quot;!&quot;.&amp;makeprg.&quot; db:fixtures:identify LABEL=&quot;.s:lastmethod(lnum)
-    call s:QuickFixCmdPost()
+    call s:pop_command()
   elseif t =~ '^fixtures\&gt;' &amp;&amp; lnum == 0
     exe &quot;make db:fixtures:load FIXTURES=&quot;.s:sub(fnamemodify(RailsFilePath(),':r'),'^.{-}/fixtures/','')
   elseif t =~ '^task\&gt;'
@@ -1085,6 +1089,14 @@ function! s:Rake(bang,lnum,arg)
     else
       make test:functionals
     endif
+  elseif RailsFilePath() =~# '\&lt;features/.*\.feature$'
+    if lnum &gt; 0
+      exe 'make features CUCUMBER_COLORS_DISABLED=1 FEATURE=&quot;%:p&quot; CUCUMBER_OPTS=--line='.lnum
+    else
+      make features CUCUMBER_COLORS_DISABLED=1 FEATURE=&quot;%:p&quot;
+    endif
+  elseif RailsFilePath() =~# '\&lt;features/'
+    make features CUCUMBER_COLORS_DISABLED=1
   else
     make
   endif
@@ -1215,9 +1227,9 @@ function! s:BufScriptWrappers()
   command! -buffer -bar -nargs=*       -complete=customlist,s:Complete_destroy  Rdestroy      :call rails#app().destroy_command(&lt;bang&gt;0,&lt;f-args&gt;)
   command! -buffer -bar -nargs=? -bang -complete=customlist,s:Complete_server   Rserver       :call rails#app().server_command(&lt;bang&gt;0,&lt;q-args&gt;)
   command! -buffer -bang -nargs=1 -range=0 -complete=customlist,s:Complete_ruby Rrunner       :call rails#app().runner_command(&lt;bang&gt;0 ? -2 : (&lt;count&gt;==&lt;line2&gt;?&lt;count&gt;:-1),&lt;f-args&gt;)
-  command! -buffer       -nargs=1 -range=0 -complete=customlist,s:Complete_ruby Rp            :call rails#app().runner_command((&lt;count&gt;==&lt;line2&gt;?&lt;count&gt;:-1,'p begin '.&lt;f-args&gt;.' end')
-  command! -buffer       -nargs=1 -range=0 -complete=customlist,s:Complete_ruby Rpp           :call rails#app().runner_command((&lt;count&gt;==&lt;line2&gt;?&lt;count&gt;:-1,'require %{pp}; pp begin '.&lt;f-args&gt;.' end')
-  command! -buffer       -nargs=1 -range=0 -complete=customlist,s:Complete_ruby Ry            :call rails#app().runner_command((&lt;count&gt;==&lt;line2&gt;?&lt;count&gt;:-1,'y begin '.&lt;f-args&gt;.' end')
+  command! -buffer       -nargs=1 -range=0 -complete=customlist,s:Complete_ruby Rp            :call rails#app().runner_command(&lt;count&gt;==&lt;line2&gt;?&lt;count&gt;:-1,'p begin '.&lt;f-args&gt;.' end')
+  command! -buffer       -nargs=1 -range=0 -complete=customlist,s:Complete_ruby Rpp           :call rails#app().runner_command(&lt;count&gt;==&lt;line2&gt;?&lt;count&gt;:-1,'require %{pp}; pp begin '.&lt;f-args&gt;.' end')
+  command! -buffer       -nargs=1 -range=0 -complete=customlist,s:Complete_ruby Ry            :call rails#app().runner_command(&lt;count&gt;==&lt;line2&gt;?&lt;count&gt;:-1,'y begin '.&lt;f-args&gt;.' end')
 endfunction
 
 function! s:app_generators() dict
@@ -1467,12 +1479,12 @@ function! s:BufNavCommands()
   command! -buffer -bar -nargs=* -complete=customlist,s:Complete_find    AS :call s:Alternate(&lt;bang&gt;0,&quot;S&quot;,&lt;f-args&gt;)
   command! -buffer -bar -nargs=* -complete=customlist,s:Complete_find    AV :call s:Alternate(&lt;bang&gt;0,&quot;V&quot;,&lt;f-args&gt;)
   command! -buffer -bar -nargs=* -complete=customlist,s:Complete_find    AT :call s:Alternate(&lt;bang&gt;0,&quot;T&quot;,&lt;f-args&gt;)
-  command! -buffer -bar -nargs=* -complete=customlist,s:Complete_related AN :call s:Related(&lt;bang&gt;0,&quot;&quot; ,&lt;f-args&gt;)
-  command! -buffer -bar -nargs=* -complete=customlist,s:Complete_related R  :call s:Related(&lt;bang&gt;0,&quot;&quot; ,&lt;f-args&gt;)
-  command! -buffer -bar -nargs=* -complete=customlist,s:Complete_related RE :call s:Related(&lt;bang&gt;0,&quot;E&quot;,&lt;f-args&gt;)
-  command! -buffer -bar -nargs=* -complete=customlist,s:Complete_related RS :call s:Related(&lt;bang&gt;0,&quot;S&quot;,&lt;f-args&gt;)
-  command! -buffer -bar -nargs=* -complete=customlist,s:Complete_related RV :call s:Related(&lt;bang&gt;0,&quot;V&quot;,&lt;f-args&gt;)
-  command! -buffer -bar -nargs=* -complete=customlist,s:Complete_related RT :call s:Related(&lt;bang&gt;0,&quot;T&quot;,&lt;f-args&gt;)
+  command! -buffer -bar -nargs=* -complete=customlist,s:Complete_edit    AN :call s:Related(&lt;bang&gt;0,&quot;&quot; ,&lt;f-args&gt;)
+  command! -buffer -bar -nargs=* -complete=customlist,s:Complete_edit    R  :call s:Related(&lt;bang&gt;0,&quot;&quot; ,&lt;f-args&gt;)
+  command! -buffer -bar -nargs=* -complete=customlist,s:Complete_edit    RE :call s:Related(&lt;bang&gt;0,&quot;E&quot;,&lt;f-args&gt;)
+  command! -buffer -bar -nargs=* -complete=customlist,s:Complete_edit    RS :call s:Related(&lt;bang&gt;0,&quot;S&quot;,&lt;f-args&gt;)
+  command! -buffer -bar -nargs=* -complete=customlist,s:Complete_edit    RV :call s:Related(&lt;bang&gt;0,&quot;V&quot;,&lt;f-args&gt;)
+  command! -buffer -bar -nargs=* -complete=customlist,s:Complete_edit    RT :call s:Related(&lt;bang&gt;0,&quot;T&quot;,&lt;f-args&gt;)
 endfunction
 
 function! s:djump(def)
@@ -1538,7 +1550,7 @@ function! s:Edit(bang,count,arg,...)
 endfunction
 
 function! s:fuzzyglob(arg)
-  return a:arg == '' ? '*' : s:gsub(a:arg,'[^/]|/$','&amp;*')
+  return '*'.s:gsub(s:gsub(a:arg,'[^/]','[&amp;]*'),'/','/*')
 endfunction
 
 function! s:Complete_find(ArgLead, CmdLine, CursorPos)
@@ -1560,14 +1572,6 @@ function! s:Complete_edit(ArgLead, CmdLine, CursorPos)
   return s:completion_filter(rails#app().relglob(&quot;&quot;,s:fuzzyglob(a:ArgLead)),a:ArgLead)
 endfunction
 
-function! s:Complete_related(ArgLead, CmdLine, CursorPos)
-  if a:ArgLead =~# '^\u'
-    return s:Complete_find(a:ArgLead, a:CmdLine, a:CursorPos)
-  else
-    return filter(s:Complete_edit(a:ArgLead, a:CmdLine, a:CursorPos),'v:val !~# &quot;^\\u&quot;')
-  endif
-endfunction
-
 function! s:Complete_cd(ArgLead, CmdLine, CursorPos)
   let all = rails#app().relglob(&quot;&quot;,a:ArgLead.&quot;*&quot;)
   call filter(all,'v:val =~ &quot;/$&quot;')
@@ -1725,9 +1729,9 @@ function! RailsNamedRoutes()
 endfunction
 
 function! s:RailsIncludefind(str,...)
-  if a:str == &quot;ApplicationController&quot;
+  if a:str ==# &quot;ApplicationController&quot;
     return &quot;app/controllers/application.rb&quot;
-  elseif a:str == &quot;Test::Unit::TestCase&quot;
+  elseif a:str ==# &quot;Test::Unit::TestCase&quot;
     return &quot;test/unit/testcase.rb&quot;
   elseif a:str == &quot;&lt;%=&quot;
     &quot; Probably a silly idea
@@ -1744,46 +1748,46 @@ function! s:RailsIncludefind(str,...)
   endif
   let str = s:sub(str,'^\s*','')
   let str = s:sub(str,'\s*$','')
-  let str = s:sub(str,'^[:@]','')
+  let str = s:sub(str,'^:=[:@]','')
   let str = s:sub(str,':0x\x+$','') &quot; For #&lt;Object:0x...&gt; style output
   let str = s:gsub(str,&quot;[\&quot;']&quot;,'')
-  if line =~ '\&lt;\(require\|load\)\s*(\s*$'
+  if line =~# '\&lt;\(require\|load\)\s*(\s*$'
     return str
   endif
   let str = rails#underscore(str)
   let fpat = '\(\s*\%(&quot;\f*&quot;\|:\f*\|'.&quot;'\\f*'&quot;.'\)\s*,\s*\)*'
-  if a:str =~ '\u'
+  if a:str =~# '\u'
     &quot; Classes should always be in .rb files
     let str .= '.rb'
-  elseif line =~ ':partial\s*=&gt;\s*'
+  elseif line =~# ':partial\s*=&gt;\s*'
     let str = s:sub(str,'([^/]+)$','_\1')
     let str = s:findview(str)
-  elseif line =~ '\&lt;layout\s*(\=\s*' || line =~ ':layout\s*=&gt;\s*'
+  elseif line =~# '\&lt;layout\s*(\=\s*' || line =~# ':layout\s*=&gt;\s*'
     let str = s:findview(s:sub(str,'^/=','layouts/'))
-  elseif line =~ ':controller\s*=&gt;\s*'
+  elseif line =~# ':controller\s*=&gt;\s*'
     let str = 'app/controllers/'.str.'_controller.rb'
-  elseif line =~ '\&lt;helper\s*(\=\s*'
+  elseif line =~# '\&lt;helper\s*(\=\s*'
     let str = 'app/helpers/'.str.'_helper.rb'
-  elseif line =~ '\&lt;fixtures\s*(\='.fpat
+  elseif line =~# '\&lt;fixtures\s*(\='.fpat
     if RailsFilePath() =~# '\&lt;spec/'
       let str = s:sub(str,'^/@!','spec/fixtures/')
     else
       let str = s:sub(str,'^/@!','test/fixtures/')
     endif
-  elseif line =~ '\&lt;stylesheet_\(link_tag\|path\)\s*(\='.fpat
+  elseif line =~# '\&lt;stylesheet_\(link_tag\|path\)\s*(\='.fpat
     let str = s:sub(str,'^/@!','/stylesheets/')
     let str = 'public'.s:sub(str,'^[^.]*$','&amp;.css')
-  elseif line =~ '\&lt;javascript_\(include_tag\|path\)\s*(\='.fpat
-    if str == &quot;defaults&quot;
+  elseif line =~# '\&lt;javascript_\(include_tag\|path\)\s*(\='.fpat
+    if str ==# &quot;defaults&quot;
       let str = &quot;application&quot;
     endif
     let str = s:sub(str,'^/@!','/javascripts/')
     let str = 'public'.s:sub(str,'^[^.]*$','&amp;.js')
-  elseif line =~ '\&lt;\(has_one\|belongs_to\)\s*(\=\s*'
+  elseif line =~# '\&lt;\(has_one\|belongs_to\)\s*(\=\s*'
     let str = 'app/models/'.str.'.rb'
-  elseif line =~ '\&lt;has_\(and_belongs_to_\)\=many\s*(\=\s*'
+  elseif line =~# '\&lt;has_\(and_belongs_to_\)\=many\s*(\=\s*'
     let str = 'app/models/'.rails#singularize(str).'.rb'
-  elseif line =~ '\&lt;def\s\+' &amp;&amp; expand(&quot;%:t&quot;) =~ '_controller\.rb'
+  elseif line =~# '\&lt;def\s\+' &amp;&amp; expand(&quot;%:t&quot;) =~# '_controller\.rb'
     let str = s:sub(s:sub(RailsFilePath(),'/controllers/','/views/'),'_controller\.rb$','/'.str)
     &quot; FIXME: support nested extensions
     let vt = s:view_types.&quot;,&quot;
@@ -1795,16 +1799,16 @@ function! s:RailsIncludefind(str,...)
         break
       endif
     endwhile
-  elseif str =~ '_\%(path\|url\)$'
+  elseif str =~# '_\%(path\|url\)$'
     &quot; REST helpers
     let str = s:sub(str,'_%(path|url)$','')
     let str = s:sub(str,'^hash_for_','')
     let file = rails#app().named_route_file(str)
     if file == &quot;&quot;
       let str = s:sub(str,'^formatted_','')
-      if str =~ '^\%(new\|edit\)_'
+      if str =~# '^\%(new\|edit\)_'
         let str = 'app/controllers/'.s:sub(rails#pluralize(str),'^(new|edit)_(.*)','\2_controller.rb#\1')
-      elseif str == rails#singularize(str)
+      elseif str ==# rails#singularize(str)
         &quot; If the word can't be singularized, it's probably a link to the show
         &quot; method.  We should verify by checking for an argument, but that's
         &quot; difficult the way things here are currently structured.
@@ -1823,7 +1827,7 @@ function! s:RailsIncludefind(str,...)
   if str =~ '^/' &amp;&amp; !filereadable(str)
     let str = s:sub(str,'^/','')
   endif
-  if str =~ '^lib/' &amp;&amp; !filereadable(str)
+  if str =~# '^lib/' &amp;&amp; !filereadable(str)
     let str = s:sub(str,'^lib/','')
   endif
   return str
@@ -1878,9 +1882,10 @@ function! s:completion_filter(results,A)
   call filter(results,'v:val !~# &quot;\\~$&quot;')
   let filtered = filter(copy(results),'s:startswith(v:val,a:A)')
   if !empty(filtered) | return filtered | endif
-  let regex = s:gsub(a:A,'.','[&amp;].*')
+  let regex = s:gsub(a:A,'[^/]','[&amp;].*')
   let filtered = filter(copy(results),'v:val =~# &quot;^&quot;.regex')
   if !empty(filtered) | return filtered | endif
+  let regex = s:gsub(a:A,'.','[&amp;].*')
   let filtered = filter(copy(results),'v:val =~# regex')
   return filtered
 endfunction
@@ -1934,10 +1939,10 @@ function! s:controllerList(A,L,P)
 endfunction
 
 function! s:viewList(A,L,P)
-  let prefix = s:sub(a:A,'[^/]*$','')
   let c = s:controller(1)
-  let top = rails#app().relglob(&quot;app/views/&quot;,prefix.&quot;*[^~]&quot;)
-  if c != '' &amp;&amp; prefix == ''
+  let top = rails#app().relglob(&quot;app/views/&quot;,s:fuzzyglob(a:A))
+  call filter(top,'v:val !~# &quot;\\~$&quot;')
+  if c != '' &amp;&amp; a:A !~ '/'
     let local = rails#app().relglob(&quot;app/views/&quot;.c.&quot;/&quot;,&quot;*.*[^~]&quot;)
     return s:completion_filter(local+top,a:A)
   endif
@@ -2012,7 +2017,7 @@ function! s:integrationtestList(A,L,P)
 endfunction
 
 function! s:specList(A,L,P)
-  return s:autocamelize(rails#app().relglob(&quot;spec/&quot;,&quot;**/*&quot;,&quot;_spec.rb&quot;),a:A)
+  return s:completion_filter(rails#app().relglob(&quot;spec/&quot;,&quot;**/*&quot;,&quot;_spec.rb&quot;),a:A)
 endfunction
 
 function! s:pluginList(A,L,P)
@@ -2546,7 +2551,7 @@ function! s:edit(cmd,file,...)
   let cmd .= ' '.(a:0 ? a:1 . ' ' : '')
   let file = a:file
   if file !~ '^/' &amp;&amp; file !~ '^\w:' &amp;&amp; file !~ '://'
-    exe cmd.&quot;`=fnamemodify(rails#app().path(file),':~:.')`&quot;
+    exe cmd.&quot;`=fnamemodify(rails#app().path(file),':.')`&quot;
   else
     exe cmd.file
   endif
@@ -2682,7 +2687,7 @@ endfunction
 
 function! s:Related(bang,cmd,...)
   if a:0
-    return call(a:1 =~# '^\u' ? 's:Find' : 's:Edit',[a:bang,1,a:cmd]+a:000)
+    return call('s:Edit',[a:bang,1,a:cmd]+a:000)
   else
     let cmd = a:cmd.(a:bang?&quot;!&quot;:&quot;&quot;)
     let file = s:RelatedFile()
@@ -2891,7 +2896,7 @@ function! s:Extract(bang,...) range abort
   else
     new
   endif
-  let shortout = fnamemodify(out,':~:.')
+  let shortout = fnamemodify(out,':.')
   silent file `=shortout`
   let &amp;ft = ft
   let @@ = partial
@@ -3046,8 +3051,8 @@ function! s:cache_clear(...) dict
 endfunction
 
 function! rails#cache_clear(...)
-  if b:rails_root != ''
-    return call(rails#app().cache.clear,a:000,rails#app())
+  if exists('b:rails_root')
+    return call(rails#app().cache.clear,a:000,rails#app().cache)
   endif
 endfunction
 
@@ -3709,10 +3714,10 @@ function! s:app_dbext_settings(environment) dict
 endfunction
 
 function! s:BufDatabase(...)
-  let self = rails#app()
-  if exists(&quot;s:lock_database&quot;) || !exists('g:loaded_dbext')
+  if exists(&quot;s:lock_database&quot;) || !exists('g:loaded_dbext') || !exists('b:rails_root')
     return
   endif
+  let self = rails#app()
   let s:lock_database = 1
   if (a:0 &amp;&amp; a:1 &gt; 1)
     call self.cache.clear('dbext_settings')
@@ -3809,7 +3814,7 @@ function! s:AddBracketExpand(abbr,expn)
 endfunction
 
 function! s:AddColonExpand(abbr,expn)
-  call s:AddSelectiveExpand(a:abbr,':',a:expn)
+  call s:AddSelectiveExpand(a:abbr,'[:.]',a:expn)
 endfunction
 
 function! s:AddParenExpand(abbr,expn,...)
@@ -4224,7 +4229,9 @@ function! RailsBufInit(path)
   call s:BufSettings()
   call s:BufCommands()
   call s:BufAbbreviations()
-  call s:BufDatabase()
+  if exists(&quot;g:loaded_dbext&quot;) &amp;&amp; g:loaded_dbext &lt; 800
+    call s:BufDatabase()
+  endif
   &quot; snippetsEmu.vim
   if exists('g:loaded_snippet')
     silent! runtime! ftplugin/rails_snippets.vim
@@ -4369,6 +4376,7 @@ augroup railsPluginAuto
   autocmd User BufEnterRails call s:RefreshBuffer()
   autocmd User BufEnterRails call s:resetomnicomplete()
   autocmd User BufEnterRails call s:BufDatabase(-1)
+  autocmd User dbextPreConnection call s:BufDatabase(1)
   autocmd BufWritePost */config/database.yml      call rails#cache_clear(&quot;dbext_settings&quot;)
   autocmd BufWritePost */test/test_helper.rb      call rails#cache_clear(&quot;user_assertions&quot;)
   autocmd BufWritePost */config/routes.rb         call rails#cache_clear(&quot;named_routes&quot;)
@@ -4377,8 +4385,8 @@ augroup railsPluginAuto
   autocmd BufWritePost */generators/**            call rails#cache_clear(&quot;generators&quot;)
   autocmd FileType * if exists(&quot;b:rails_root&quot;) | call s:BufSettings() | endif
   autocmd Syntax ruby,eruby,yaml,haml,javascript,railslog if exists(&quot;b:rails_root&quot;) | call s:BufSyntax() | endif
-  silent! autocmd QuickFixCmdPre  make* call s:QuickFixCmdPre()
-  silent! autocmd QuickFixCmdPost make* call s:QuickFixCmdPost()
+  autocmd QuickFixCmdPre  make* call s:push_chdir()
+  autocmd QuickFixCmdPost make* call s:pop_command()
 augroup END
 
 &quot; }}}1</diff>
      <filename>autoload/rails.vim</filename>
    </modified>
    <modified>
      <diff>@@ -681,16 +681,19 @@ place) are also covered in this section.
 			is installed.  Loads the {environment} configuration
 			(defaults to $RAILS_ENV or development) from
 			config/database.yml and uses it to configure dbext.
-			The configuration is cached until a different Rails
-			application is edited.  This command is called for you
-			automatically when |g:rails_dbext| is set (default on
-			non-Windows systems).
+			The configuration is cached on a per application
+			basis.  With dbext versions 8.00 and newer, this
+			command is called automatically when needed.  For
+			older versions, it is called automatically when
+			rails.vim loads if |g:rails_dbext| is set (which it is
+			by default).
 
 						*rails-:Rdbext!*
 :Rdbext! [{environment}]
 			Load the database configuration as above, and then
 			attempt a CREATE DATABASE for it.  This is primarily
-			useful for demonstrations.
+			useful for demonstrations, and has been largely
+			superseded by |:Rake| db:create.
 
 						*rails-surround*
 The |surround| plugin available from vim.org enables adding and removing
@@ -798,7 +801,7 @@ Rabbrev pa[ params		pa.inspect		params.inspect
 Rabbrev AR:: ActionRecord	AR::Base		ActiveRecord::Base
 Rabbrev :a :action\ =&gt;\		render :a&lt;Tab&gt;		render :action =&gt; 
 
-In short, :: expands on :, ( expands on (, and [ expands on both . and [.
+In short, ( expands on (, :: expands on . and :, and [ expands on . and [.
 These trailing punctuation marks are NOT part of the final abbreviation, and
 you cannot have two mappings that differ only by punctuation.
 
@@ -807,11 +810,11 @@ an abbreviation ending with &quot;(&quot;, you may define where to insert the
 parenthesis by splitting the expansion into two parts (divided by an unescaped
 space).
 
-Many abbreviations abbreviations are provided by default: use :Rabbrev to list
-them.  They vary depending on the type of file (models have different
-abbreviations than controllers).  There is one &quot;smart&quot; abbreviation, :c, which
-expands to &quot;:controller =&gt; &quot;, &quot;:collection =&gt; &quot;, or &quot;:conditions =&gt; &quot;
-depending on context.
+Many abbreviations are provided by default: use :Rabbrev to list them.  They
+vary depending on the type of file (models have different abbreviations than
+controllers).  There is one &quot;smart&quot; abbreviation, :c, which expands to
+&quot;:controller =&gt; &quot;, &quot;:collection =&gt; &quot;, or &quot;:conditions =&gt; &quot; depending on
+context.
 
 ==============================================================================
 SYNTAX HIGHLIGHTING				*rails-syntax*</diff>
      <filename>doc/rails.txt</filename>
    </modified>
    <modified>
      <diff>@@ -107,7 +107,7 @@ function! s:Detect(filename)
     return s:BufInit(strpart(fn,0,strlen(fn)-22))
   endif
   if isdirectory(fn)
-    let fn = fnamemodify(fn,&quot;:s?[\/]$??&quot;)
+    let fn = fnamemodify(fn,':s?[\/]$??')
   else
     let fn = fnamemodify(fn,':s?\(.*\)[\/][^\/]*$?\1?')
   endif</diff>
      <filename>plugin/rails.vim</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>07d5ca1eaf8f1f26aba7534e7372410ff3202a56</id>
    </parent>
  </parents>
  <author>
    <name>Martin Grenfell</name>
    <email>martin_grenfell@msn.com</email>
  </author>
  <url>http://github.com/andhapp/vimfiles/commit/093735c25ad2d95a1736c3f79baf56f0368b1bcc</url>
  <id>093735c25ad2d95a1736c3f79baf56f0368b1bcc</id>
  <committed-date>2008-11-19T00:01:38-08:00</committed-date>
  <authored-date>2008-11-19T00:01:38-08:00</authored-date>
  <message>latest rails.vim</message>
  <tree>7cd160e6a24b6d6cacaa932bc240a1398d182821</tree>
  <committer>
    <name>Martin Grenfell</name>
    <email>martin_grenfell@msn.com</email>
  </committer>
</commit>
