<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -54,17 +54,21 @@ Go to your Rails project:
 
   $ cd your_rails_project
 
-Create a new migration:
+Create the migration and model:
 
-  $ ar_sendmail --create-migration Emails
+This shows the options which are only the model name, which defaults to Email
 
-You'll need to redirect this into a file.
+  ./script/generate ar_mailer -h
 
-Create a new model:
+Then run with defaults
 
-  $ ar_sendmail --create-model Email
+  ./script/generate ar_mailer
 
-You'll need to redirect this into a file.
+Or specify a custom model name
+
+  ./script/generate ar_mailer Newsletter
+
+See Alternate Mail Storage if you use a custom model name
 
 In your mailer class methods you must be sure to set the From address for your emails.
 Something like:</diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -37,8 +37,6 @@ module ActionMailer; end # :nodoc:
 # The interesting options are:
 # * --daemon
 # * --mailq
-# * --create-migration
-# * --create-model
 
 class ActionMailer::ARSendmail
 
@@ -98,41 +96,6 @@ class ActionMailer::ARSendmail
   end
 
   ##
-  # Creates a new migration using +table_name+ and prints it on stdout.
-
-  def self.create_migration(table_name)
-    require 'active_support'
-    puts &lt;&lt;-EOF
-class Create#{table_name.classify} &lt; ActiveRecord::Migration
-  def self.up
-    create_table :#{table_name.tableize} do |t|
-      t.column :from, :string
-      t.column :to, :string
-      t.column :last_send_attempt, :integer, :default =&gt; 0
-      t.column :mail, :text
-      t.column :created_on, :datetime
-    end
-  end
-
-  def self.down
-    drop_table :#{table_name.tableize}
-  end
-end
-    EOF
-  end
-
-  ##
-  # Creates a new model using +model_name+ and prints it on stdout.
-
-  def self.create_model(model_name)
-    require 'active_support'
-    puts &lt;&lt;-EOF
-class #{model_name.classify} &lt; ActiveRecord::Base
-end
-    EOF
-  end
-
-  ##
   # Prints a list of unsent emails and the last delivery attempt, if any.
   #
   # If ActiveRecord::Timestamp is not being used the arrival time will not be
@@ -250,18 +213,6 @@ end
       opts.separator ''
       opts.separator 'Setup Options:'
 
-      opts.on(      &quot;--create-migration TABLE_NAME&quot;,
-              &quot;Prints a migration to add an Email table&quot;,
-              &quot;to stdout&quot;) do |name|
-        options[:Migrate] = name
-      end
-
-      opts.on(      &quot;--create-model MODEL_NAME&quot;,
-              &quot;Prints a model for an Email ActiveRecord&quot;,
-              &quot;object to stdout&quot;) do |name|
-        options[:Model] = name
-      end
-
       opts.separator ''
       opts.separator 'Generic Options:'
 
@@ -299,8 +250,6 @@ end
 
     opts.parse! args
 
-    return options if options.include? :Migrate or options.include? :Model
- 
     ENV['RAILS_ENV'] = options[:RailsEnv]
 
     Dir.chdir options[:Chdir] do
@@ -310,7 +259,7 @@ end
         usage opts, &lt;&lt;-EOF
 #{name} must be run from a Rails application's root to deliver email.
 #{Dir.pwd} does not appear to be a Rails application root.
-          EOF
+        EOF
       end
     end
 
@@ -323,13 +272,7 @@ end
   def self.run(args = ARGV)
     options = process_args args
 
-    if options.include? :Migrate then
-      create_migration options[:Migrate]
-      exit
-    elsif options.include? :Model then
-      create_model options[:Model]
-      exit
-    elsif options.include? :MailQ then
+    if options.include? :MailQ then
       mailq
       exit
     end</diff>
      <filename>lib/action_mailer/ar_sendmail.rb</filename>
    </modified>
    <modified>
      <diff>@@ -33,45 +33,6 @@ class TestARSendmail &lt; MiniTest::Unit::TestCase
     $&quot;.delete 'config/environment.rb' unless @include_c_e
   end
 
-  def test_class_create_migration
-    out, = capture_io do
-      ActionMailer::ARSendmail.create_migration 'Mail'
-    end
-
-    expected = &lt;&lt;-EOF
-class CreateMail &lt; ActiveRecord::Migration
-  def self.up
-    create_table :mail do |t|
-      t.column :from, :string
-      t.column :to, :string
-      t.column :last_send_attempt, :integer, :default =&gt; 0
-      t.column :mail, :text
-      t.column :created_on, :datetime
-    end
-  end
-
-  def self.down
-    drop_table :mail
-  end
-end
-    EOF
-
-    assert_equal expected, out
-  end
-
-  def test_class_create_model
-    out, = capture_io do
-      ActionMailer::ARSendmail.create_model 'Mail'
-    end
-
-    expected = &lt;&lt;-EOF
-class Mail &lt; ActiveRecord::Base
-end
-    EOF
-
-    assert_equal expected, out
-  end
-
   def test_class_mailq
     Email.create :from =&gt; nobody, :to =&gt; 'recip@h1.example.com',
                  :mail =&gt; 'body0'
@@ -249,28 +210,6 @@ Last send attempt: Thu Aug 10 11:40:05 %s 2006
     assert_equal 86400, options[:MaxAge]
   end
 
-  def test_class_parse_args_migration
-    options = ActionMailer::ARSendmail.process_args []
-    refute_includes options, :Migration
-
-    argv = %w[--create-migration Emails]
-    
-    options = ActionMailer::ARSendmail.process_args argv
-
-    assert_equal 'Emails', options[:Migrate]
-  end
-
-  def test_class_parse_args_model
-    options = ActionMailer::ARSendmail.process_args []
-    refute_includes options, :Model
-
-    argv = %w[--create-model Email]
-    
-    options = ActionMailer::ARSendmail.process_args argv
-
-    assert_equal 'Email', options[:Model]
-  end
-
   def test_class_parse_args_no_config_environment
     $&quot;.delete 'config/environment.rb'
 
@@ -284,35 +223,6 @@ Last send attempt: Thu Aug 10 11:40:05 %s 2006
     $&quot; &lt;&lt; 'config/environment.rb' if @include_c_e
   end
 
-  def test_class_parse_args_no_config_environment_migrate
-    $&quot;.delete 'config/environment.rb'
-
-    out, err = capture_io do
-      ActionMailer::ARSendmail.process_args %w[--create-migration Emails]
-    end
-
-    assert true # count
-
-  ensure
-    $&quot; &lt;&lt; 'config/environment.rb' if @include_c_e
-  end
-
-  def test_class_parse_args_no_config_environment_model
-    $&quot;.delete 'config/environment.rb'
-
-    out, err = capture_io do
-      ActionMailer::ARSendmail.process_args %w[--create-model Email]
-    end
-
-    assert true # count
-
-  rescue SystemExit
-    flunk 'Should not exit'
-
-  ensure
-    $&quot; &lt;&lt; 'config/environment.rb' if @include_c_e
-  end
-
   def test_class_parse_args_once
     argv = %w[-o]
     </diff>
      <filename>test/test_arsendmail.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5866745e4e6a3e859e5e362f2aeb28ff09d0ca8c</id>
    </parent>
  </parents>
  <author>
    <name>Adam Meehan</name>
    <email>adam.meehan@gmail.com</email>
  </author>
  <url>http://github.com/adzap/ar_mailer/commit/c9cbc58b7b77a3c3d393ae3b96c286af1ac0a4b5</url>
  <id>c9cbc58b7b77a3c3d393ae3b96c286af1ac0a4b5</id>
  <committed-date>2009-06-23T02:04:09-07:00</committed-date>
  <authored-date>2009-06-23T02:04:09-07:00</authored-date>
  <message>remove cli migration and model generation
add instructions for generator to readme</message>
  <tree>28a5fed5a3a1424aae85db3c2210693a2d3e622c</tree>
  <committer>
    <name>Adam Meehan</name>
    <email>adam.meehan@gmail.com</email>
  </committer>
</commit>
