Sha256: 04d9796e9dff5dbf03d518856aaeb525ee31137c5f95ef74d1048fc1f5da567f

Contents?: true

Size: 832 Bytes

Versions: 1

Compression:

Stored size: 832 Bytes

Contents

 require 'rails/generators'
 require 'rails/generators/migration'     
 #require 'rails/generators/create_site_signups'

 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
   end
 end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ccs_core_gem-0.0.2 lib/generators/ccs_core_gem/ccs_core_gem_generator.rb