Sha256: be4dc90c4026f55d707c8447f59b87e95247cd0f9d7272ade8526e4acc26d01e

Contents?: true

Size: 690 Bytes

Versions: 49

Compression:

Stored size: 690 Bytes

Contents

class ArMailerGenerator < Rails::Generator::NamedBase

  def initialize(runtime_args, runtime_options = {})
    runtime_args.unshift('Email') if runtime_args.empty?
    super
  end

  def manifest
    record do |m|
      m.class_collisions class_name
      
      m.template 'model.rb', File.join('app/models', class_path, "#{file_name}.rb")

      m.migration_template 'migration.rb', 'db/migrate', :assigns => {
        :migration_name => "Create#{class_name.pluralize.gsub(/::/, '')}"
      }, :migration_file_name => "create_#{file_path.gsub(/\//, '_').pluralize}"
    end
  end

  protected
    def banner
      "Usage: #{$0} #{spec.name} EmailModelName (default: Email)"
    end

end

Version data entries

49 entries across 49 versions & 18 rubygems

Version Path
zendesk-ar_mailer-2.1.5 generators/ar_mailer/ar_mailer_generator.rb
catalogchoice-ar_mailer-2.1.7 generators/ar_mailer/ar_mailer_generator.rb
axtro-ar_mailer-2.1.6 generators/ar_mailer/ar_mailer_generator.rb
catalogchoice-ar_mailer-2.1.6 generators/ar_mailer/ar_mailer_generator.rb
adzap-ar_mailer-2.1.5 generators/ar_mailer/ar_mailer_generator.rb
axtro-ar_mailer-2.1.5 generators/ar_mailer/ar_mailer_generator.rb
scambra-ar_mailer-2.1.6 generators/ar_mailer/ar_mailer_generator.rb
maedana-ar_mailer-2.1.6.1 generators/ar_mailer/ar_mailer_generator.rb
maedana-ar_mailer-2.1.6 generators/ar_mailer/ar_mailer_generator.rb