Permalink
Browse files

Fixed autocomplete bug when model has no associations. Thanks alobato…

… (Arley Lobato).

Changed Create functional test snippet.
  • Loading branch information...
1 parent 9ead074 commit 54fa7b253bb99a083fc2137cda6a4648f7694197 @carlosbrando carlosbrando committed Jun 28, 2010
Showing with 5 additions and 3 deletions.
  1. +2 −2 Snippets/Create functional test class.tmSnippet
  2. +3 −1 Support/bin/list_columns.rb
View
4 Snippets/Create functional test class.tmSnippet
@@ -3,10 +3,10 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>require File.dirname(__FILE__) + '/../test_helper'
+ <string>require 'test_helper'
class ${1:Model}ControllerTest &lt; ActionController::TestCase
- deft$0
+ test$0
end
</string>
<key>name</key>
View
4 Support/bin/list_columns.rb
@@ -62,8 +62,10 @@ def clone_cache(klass, new_word)
def display_menu(klass)
columns = cache[klass][:columns]
associations = cache[klass][:associations]
+
+ options = associations.empty? ? [] : associations + [nil]
+ options += columns + [nil, RELOAD_MESSAGE]
- options = associations + [nil] + columns + [nil, RELOAD_MESSAGE]
selected = TextMate::UI.menu(options)
return if selected.nil?

0 comments on commit 54fa7b2

Please sign in to comment.