Class: UserPreferences::Generators::InstallGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dir) ⇒ Object

TODO get rid of this



16
17
18
# File 'lib/generators/user_preferences/install_generator.rb', line 16

def self.next_migration_number(dir)
  Time.now.utc.strftime("%Y%m%d%H%M%S")
end

Instance Method Details

#copy_migrationsObject



11
12
13
# File 'lib/generators/user_preferences/install_generator.rb', line 11

def copy_migrations
  migration_template 'migration.rb', "db/migrate/create_preferences.rb"
end

#create_initializer_fileObject



7
8
9
# File 'lib/generators/user_preferences/install_generator.rb', line 7

def create_initializer_file
  template 'user_preferences.yml', "config/user_preferences.yml"
end