class EnumGenerator
Generator for PowerEnum
Public Instance Methods
Source
# File lib/generators/enum/enum_generator.rb, line 23 def generate_migration @description = options.description? migration_template 'rails31_migration.rb.erb', "db/migrate/create_enum_#{table_name}.rb" if options.migration? end
Generates the migration to create the enum table.
Source
# File lib/generators/enum/enum_generator.rb, line 18 def generate_model template 'model.rb.erb', File.join('app/models', class_path, "#{file_name}.rb") end
Generates the enum ActiveRecord
model.
Source
# File lib/generators/enum/enum_generator.rb, line 29 def pluralize_table_names? false end
Do not pluralize enumeration names