Skip to content
Browse files

rails-core.el (rails-core:model-exist-p): fixed error, when model-fil…

…e not exists.

git-svn-id: svn+ssh://rubyforge.org/var/svn/emacs-rails/trunk@219 cc5033d0-740f-0410-afc7-949910e492f2
  • Loading branch information...
1 parent 1ff2c51 commit 31feec458ec33d9f97d41d271de8885976280b29 dimaexe committed Nov 3, 2007
Showing with 11 additions and 7 deletions.
  1. +4 −0 ChangeLog
  2. +7 −7 rails-core.el
View
4 ChangeLog
@@ -1,3 +1,7 @@
+2007-11-04 Dmitry Galinsky <dima.exe@gmail.com>
+
+ * rails-core.el (rails-core:model-exist-p): fixed error, when model-file not exists.
+
2007-11-03 Dmitry Galinsky <dima.exe@gmail.com>
* rails-core.el (rails-core:model-file
View
14 rails-core.el
@@ -120,16 +120,16 @@ it does not exist, ask to create it using QUESTION as a prompt."
(concat "app/models/" model-file))
((file-exists-p
(rails-core:file (concat "app/models/" stripped-model-file)))
- (concat "app/models/" stripped-model-file))))))
+ (concat "app/models/" stripped-model-file))
+ (t nil)))))
(defun rails-core:model-exist-p (model-name)
"Return t if model MODEL-NAME exist."
- (when model-name
- (and (file-exists-p
- (rails-core:file
- (rails-core:model-file model-name)))
- (not (rails-core:observer-p model-name))
- (not (rails-core:mailer-p model-name)))))
+ (let ((model-file (rails-core:model-file model-name)))
+ (when model-file
+ (and (file-exists-p (rails-core:file model-file))
+ (not (rails-core:observer-p model-name))
+ (not (rails-core:mailer-p model-name))))))
(defun rails-core:controller-file (controller-name)
"Return the path to the controller CONTROLLER-NAME."

0 comments on commit 31feec4

Please sign in to comment.
Something went wrong with that request. Please try again.