Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Missing destroy command

  • Loading branch information...
commit 1eebfc9f66149020efe23a620da110424e5a5c33 1 parent defdeed
@amatsuda amatsuda authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 railties/lib/rails/commands/commands_tasks.rb
View
4 railties/lib/rails/commands/commands_tasks.rb
@@ -51,6 +51,10 @@ def generate
generate_or_destroy(:generate)
end
+ def destroy
+ generate_or_destroy(:destroy)
+ end
+
def console
require_command!("console")
options = Rails::Console.parse_arguments(argv)

3 comments on commit 1eebfc9

@rajcybage

required test cases for it.....

@soundarapandian

@amatsuda I was fixed this in 12142. But core team asked the test cases. I am experiencing some problem in writing test cases.If you can assist I can complete that.

@amatsuda
Collaborator

@soundarapandian Oops! I didn't notice the ongoing discussion there... I'm so sorry for that.
Actually I firstly tried to write a test for this, but found out that the test code is going to be very tricky.
I guess we'd better refactor each command in a separate commit to be implemented in command pattern such as:

module Rails
  module Command
    class Destroy
      def execute(*args)
        ..
ennnnd

so that we could easily stub for testing.

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