Skip to content

Commit 4d2ae2b

Browse files
committed
Disable :Rbext! creating a new database
1 parent 3847b1b commit 4d2ae2b

File tree

2 files changed

+1
-23
lines changed

2 files changed

+1
-23
lines changed

autoload/rails.vim

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ function! s:BufCommands()
754754
endif
755755
command! -buffer -bar -nargs=? Rproject :call s:warn("Warning: :Rproject has been deprecated in favor of :Rtree") | Rtree<bang> <args>
756756
if exists("g:loaded_dbext")
757-
command! -buffer -bar -nargs=? -bang -complete=customlist,s:Complete_environments Rdbext :call s:BufDatabase(2,<q-args>,<bang>0)|let b:dbext_buffer_defaulted = 1
757+
command! -buffer -bar -nargs=? -complete=customlist,s:Complete_environments Rdbext :call s:BufDatabase(2,<q-args>)|let b:dbext_buffer_defaulted = 1
758758
endif
759759
let ext = expand("%:e")
760760
if ext =~ s:viewspattern()
@@ -3820,21 +3820,6 @@ function! s:BufDatabase(...)
38203820
elseif exists('$PGPASSWORD')
38213821
let $PGPASSWORD = ''
38223822
endif
3823-
if a:0 >= 3 && a:3 && exists(":Create")
3824-
if exists("b:dbext_dbname") && exists("b:dbext_type") && b:dbext_type !~? 'sqlite'
3825-
let db = b:dbext_dbname
3826-
if b:dbext_type == 'PGSQL'
3827-
" I don't always have a default database for a user so using the
3828-
" default user's database is a better choice for my setup. It
3829-
" probably won't work for everyone but nothing will.
3830-
let b:dbext_dbname = 'postgres'
3831-
else
3832-
let b:dbext_dbname = ''
3833-
endif
3834-
exe "Create database ".db
3835-
let b:dbext_dbname = db
3836-
endif
3837-
endif
38383823
unlet! s:lock_database
38393824
endfunction
38403825

doc/rails.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -697,13 +697,6 @@ place) are also covered in this section.
697697
rails.vim loads if |g:rails_dbext| is set (which it is
698698
by default).
699699

700-
*rails-:Rdbext!*
701-
:Rdbext! [{environment}]
702-
Load the database configuration as above, and then
703-
attempt a CREATE DATABASE for it. This is primarily
704-
useful for demonstrations, and has been largely
705-
superseded by |:Rake| db:create.
706-
707700
*rails-surround*
708701
The |surround| plugin available from vim.org enables adding and removing
709702
"surroundings" like parentheses, quotes, and HTML tags. Even by itself, it is

0 commit comments

Comments
 (0)