Sha256: ce0d129b459c0a5dc693fa17e8ec476998c87bb21c6e49e8ed0c517f7aac12f0

Contents?: true

Size: 463 Bytes

Versions: 3

Compression:

Stored size: 463 Bytes

Contents

class AuditedMigrationGenerator < Rails::Generator::NamedBase
  def initialize(runtime_args, runtime_options = {})
    super
    @human_model = runtime_args[1] ? runtime_args[1].underscore : 'user'
  end

  def manifest
    record do |m|
      m.migration_template 'migration.rb', 'db/migrate', :assigns => { :human_model => @human_model }
    end
  end

  protected

  def banner
    "Usage: #{$0} audited_migration add_audits_table [human_model_name]"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
acts_as_audited_customized-1.3.2 generators/audited_migration/audited_migration_generator.rb
acts_as_audited_customized-1.3.1 generators/audited_migration/audited_migration_generator.rb
acts_as_audited_customized-1.2.2 generators/audited_migration/audited_migration_generator.rb