Skip to content

Commit

Permalink
rails-core.el (rails-core:model-exist-p): fixed error, when model-fil…
Browse files Browse the repository at this point in the history
…e not exists.

git-svn-id: svn+ssh://rubyforge.org/var/svn/emacs-rails/trunk@219 cc5033d0-740f-0410-afc7-949910e492f2
  • Loading branch information
dimaexe committed Nov 3, 2007
1 parent 1ff2c51 commit 31feec4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2007-11-04 Dmitry Galinsky <[email protected]>

* rails-core.el (rails-core:model-exist-p): fixed error, when model-file not exists.

2007-11-03 Dmitry Galinsky <[email protected]>

* rails-core.el (rails-core:model-file
Expand Down
14 changes: 7 additions & 7 deletions rails-core.el
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit 31feec4

Please sign in to comment.