Class: Subscribable::Generators::SubRelationGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/subscribable/sub_relation_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



13
14
15
# File 'lib/generators/subscribable/sub_relation_generator.rb', line 13

def self.next_migration_number(path)
  @migration_number = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i.to_s
end

Instance Method Details

#generate_migrationObject



9
10
11
# File 'lib/generators/subscribable/sub_relation_generator.rb', line 9

def generate_migration
  migration_template 'sub_relation_migration.rb', 'db/migrate/create_sub_relation.rb'
end