Sha256: 58a98ca0d1b4fe91a944ff585f8f936e530f212e93f6160a9b80efc2c3fd5e54
Contents?: true
Size: 661 Bytes
Versions: 24
Compression:
Stored size: 661 Bytes
Contents
require 'rails/generators' module ConfigurableEngine class InstallGenerator < Rails::Generators::Base include Rails::Generators::Migration def self.source_root @source_root ||= File.join(File.dirname(__FILE__), 'templates') end def self.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 def create_migration_file copy_file 'configurable.yml', 'config/configurable.yml' migration_template 'migration.rb', 'db/migrate/create_configurables.rb' end end end
Version data entries
24 entries across 24 versions & 1 rubygems