Sha256: ddc1a9a3037c5ecfa89e122122e6ab19907473073ca3e3049a16467f549fb1dd

Contents?: true

Size: 625 Bytes

Versions: 9

Compression:

Stored size: 625 Bytes

Contents

module ActiveRecord
  module Generators
    class ImpressionistGenerator < Rails::Generators::Base
      include Rails::Generators::Migration
      source_root File.join(File.dirname(__FILE__), 'templates')

      def self.next_migration_number(dirname)
        sleep 1
        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
        migration_template 'create_impressions_table.rb', 'db/migrate/create_impressions_table.rb'
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
impressionist-1.4.2 lib/generators/active_record/impressionist_generator.rb
impressionist-1.4.1 lib/generators/active_record/impressionist_generator.rb
impressionist-1.4.0 lib/generators/active_record/impressionist_generator.rb
impressionist-1.3.2 lib/generators/active_record/impressionist_generator.rb
impressionist-1.3.1 lib/generators/active_record/impressionist_generator.rb
impressionist-1.3.0 lib/generators/active_record/impressionist_generator.rb
impressionist-1.2.0 lib/generators/active_record/impressionist_generator.rb
impressionist-1.1.1 lib/generators/active_record/impressionist_generator.rb
impressionist-1.1.0 lib/generators/active_record/impressionist_generator.rb