Permalink
Browse files

rails-core.el (rails-core:model-file

  rails-core:controller-file-by-model): search namespaced models and
  controllers.


git-svn-id: svn+ssh://rubyforge.org/var/svn/emacs-rails/trunk@218 cc5033d0-740f-0410-afc7-949910e492f2
  • Loading branch information...
dimaexe
dimaexe committed Nov 2, 2007
1 parent c5ba131 commit 1ff2c51b8c28fa8591ed177879a1efa351c868ce
Showing with 14 additions and 3 deletions.
  1. +3 −1 ChangeLog
  2. +11 −2 rails-core.el
View
@@ -1,6 +1,8 @@
2007-11-03 Dmitry Galinsky <dima.exe@gmail.com>
- * rails-core.el (rails-core:model-file): search namespaced models.
+ * rails-core.el (rails-core:model-file
+ rails-core:controller-file-by-model): search namespaced models and
+ controllers.
* rails-test.el (rails-test:line-regexp): applled patch by Alan Shields,
don't hightlight whitespaces in test output.
View
@@ -154,7 +154,17 @@ it does not exist, ask to create it using QUESTION as a prompt."
(setq controller
(cond
((rails-core:controller-exist-p controller) controller) ;; pluralized
- ((rails-core:controller-exist-p model) model))) ;; singularized
+ ((rails-core:controller-exist-p model) model) ;; singularized
+ (t (let ((controllers (rails-core:controllers t)))
+ (cond
+ ;; with namespace
+ ((find
+ (list controller model)
+ controllers
+ :test #'(lambda(x y)
+ (or
+ (string= (car x) (rails-core:strip-namespace y))
+ (string= (cadr x) (rails-core:strip-namespace y)))))))))))
(when controller
(rails-core:controller-file controller)))))
@@ -569,7 +579,6 @@ cannot be determinated."
(when line-number
(goto-line line-number)))))
-
;;;;;;;;;; Rails minor mode logs ;;;;;;;;;;
(defun rails-log-add (message)

0 comments on commit 1ff2c51

Please sign in to comment.