Class: Fdbq::Rails::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/fdbq/rails/install_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/generators/fdbq/rails/install_generator.rb', line 14

def next_migration_number(dirname)
  if ActiveRecord::Base.timestamped_migrations
    Time.now.utc.strftime("%Y%m%d%H%M%S")
  else
    "%.3d" % (current_migration_number(dirname) + 1)
  end
end

Instance Method Details

#copy_configObject



23
24
25
# File 'lib/generators/fdbq/rails/install_generator.rb', line 23

def copy_config
  template "fdbq.yml", "config/fdbq.yml"
end

#copy_initializerObject



31
32
33
# File 'lib/generators/fdbq/rails/install_generator.rb', line 31

def copy_initializer
  template "fdbq.rb", "config/initializers/fdbq.rb"
end

#copy_localesObject



35
36
37
# File 'lib/generators/fdbq/rails/install_generator.rb', line 35

def copy_locales
  template "fdbq.en.yml", "config/locales/fdbq.en.yml"
end

#copy_migrationObject



27
28
29
# File 'lib/generators/fdbq/rails/install_generator.rb', line 27

def copy_migration
  migration_template "create_fdbq_feedback.rb", "db/migrate/create_fdbq_feedback.rb"
end