Class: Mailboxer::NamespacingCompatibilityGenerator

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

Constant Summary collapse

FILENAME =
'mailboxer_namespacing_compatibility.rb'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/generators/mailboxer/namespacing_compatibility_generator.rb', line 14

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

Instance Method Details

#create_model_fileObject



10
11
12
# File 'lib/generators/mailboxer/namespacing_compatibility_generator.rb', line 10

def create_model_file
  migration_template FILENAME, "db/migrate/#{FILENAME}"
end