Class: Merb::Generators::MigrationGenerator
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Generator
#initialize, #with_modules
Class Method Details
.source_root ⇒ Object
5
6
7
|
# File 'lib/merb-gen/migration.rb', line 5
def self.source_root
File.join(super, 'migration')
end
|
Instance Method Details
#class_name ⇒ Object
38
39
40
|
# File 'lib/merb-gen/migration.rb', line 38
def class_name
self.name.camel_case
end
|
#file_name ⇒ Object
46
47
48
|
# File 'lib/merb-gen/migration.rb', line 46
def file_name
"#{version}_#{migration_name}"
end
|
#migration_name ⇒ Object
42
43
44
|
# File 'lib/merb-gen/migration.rb', line 42
def migration_name
self.name.snake_case
end
|
#table_name ⇒ Object
34
35
36
|
# File 'lib/merb-gen/migration.rb', line 34
def table_name
self.name.snake_case.pluralize
end
|
#version ⇒ Object
50
51
52
53
|
# File 'lib/merb-gen/migration.rb', line 50
def version
format("%03d", current_migration_nr + 1)
end
|