Sha256: e0947f69c9e746cc2cb62b05928caea93dc59e4beca81f4acfe8461ec396987e

Contents?: true

Size: 712 Bytes

Versions: 4

Compression:

Stored size: 712 Bytes

Contents

class AttachmentGenerator < Rails::Generator::Base
  default_options :skip_migration => false
  
  def manifest    
    record do |m|
      unless options[:skip_migration]
        m.migration_template("migration.rb", "db/migrate", :migration_file_name => "create_attachment")
      end
      m.template('model.rb', 'app/models/attachment.rb')
      m.readme "../REMEMBER"      
    end
  end 


  protected
    def banner
      "Usage: #{$0} attachment [--skip-migration]"
    end
    
    def add_options!(opt)
      opt.separator ''
      opt.separator 'Options:'
      opt.on("--skip-migration",
             "Don't generate a migration file for this model") { |v| options[:skip_migration] = v }
    end
 
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lipsiadmin-3.0 lipsiadmin_generators/attachment/attachment_generator.rb
lipsiadmin-2.9 lipsiadmin_generators/attachment/attachment_generator.rb
lipsiadmin-3.1 lipsiadmin_generators/attachment/attachment_generator.rb
lipsiadmin-3.2 lipsiadmin_generators/attachment/attachment_generator.rb