Class: ActiveRecord::Generators::ViewsCountGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- ActiveRecord::Generators::ViewsCountGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/active_record/views_count_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(dirname) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/generators/active_record/views_count_generator.rb', line 7 def self.next_migration_number(dirname) if ActiveRecord::Base. Time.now.utc.strftime("%Y%m%d%H%M%S") else "%.3d" % (current_migration_number(dirname) + 1) end end |
Instance Method Details
#create_migration_file ⇒ Object
15 16 17 |
# File 'lib/generators/active_record/views_count_generator.rb', line 15 def create_migration_file migration_template 'create_view_items_table.rb', 'db/migrate/create_view_items_table.rb' end |