Sha256: b4c50f35e7ebdb5f116c8835c39b0846abb52a47ccf32bc87729bd0ce031770b
Contents?: true
Size: 969 Bytes
Versions: 4
Compression:
Stored size: 969 Bytes
Contents
require 'rails/generators' require 'rails/generators/migration' class CcsCoreGemGenerator < 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_files begin migration_template 'create_site_details.rb', 'db/migrate/create_site_details.rb' rescue end sleep 2 begin migration_template 'create_site_signups.rb', 'db/migrate/create_site_signups.rb' rescue end begin template 'service_locator.rb', 'lib/service_locator.rb' rescue end begin template 'services.yml', 'config/services.yml' rescue end end end
Version data entries
4 entries across 4 versions & 1 rubygems