class EnumGenerator

Generator for PowerEnum

Public Instance Methods

generate_migration() click to toggle source

Generates the migration to create the enum table.

# File lib/generators/enum/enum_generator.rb, line 21
def generate_migration
  @description = options.description?
  migration_template 'rails31_migration.rb.erb', "db/migrate/create_enum_#{table_name}.rb" if options.migration?
end
generate_model() click to toggle source

Generates the enum ActiveRecord model.

# File lib/generators/enum/enum_generator.rb, line 16
def generate_model
  template 'model.rb.erb', File.join('app/models', class_path, "#{file_name}.rb")
end
pluralize_table_names?() click to toggle source

Do not pluralize enumeration names

# File lib/generators/enum/enum_generator.rb, line 27
def pluralize_table_names?
  false
end