Class: HierarchyGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- HierarchyGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/hierarchy_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(dirname) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/hierarchy_generator.rb', line 11 def self.next_migration_number(dirname) if ActiveRecord::Base. then Time.now.utc.strftime '%Y%m%d%H%M%S' else '%.3d' % (current_migration_number(dirname) + 1) end end |
Instance Method Details
#copy_files ⇒ Object
19 20 21 |
# File 'lib/hierarchy_generator.rb', line 19 def copy_files migration_template 'add_ltree_type.rb', 'db/migrate/add_ltree_type.rb' end |