Sha256: 3d9a34abfe562cf93ebf198396e35ce368c06eb2f7a6211d31e39ba09b2c9bfb

Contents?: true

Size: 680 Bytes

Versions: 20

Compression:

Stored size: 680 Bytes

Contents

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

      # FIX, why is this implementing rails behaviour?
      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

20 entries across 20 versions & 2 rubygems

Version Path
impressionist-2.0.0 lib/generators/active_record/impressionist_generator.rb
impressionist-1.6.1 lib/generators/active_record/impressionist_generator.rb
impressionist-1.6.0 lib/generators/active_record/impressionist_generator.rb
impressionist-1.5.2 lib/generators/active_record/impressionist_generator.rb
impressionist2-1.5.5 lib/generators/active_record/impressionist_generator.rb
impressionist2-1.5.4 lib/generators/active_record/impressionist_generator.rb
impressionist2-1.5.3 lib/generators/active_record/impressionist_generator.rb
impressionist2-1.5.1 lib/generators/active_record/impressionist_generator.rb
impressionist-1.5.1 lib/generators/active_record/impressionist_generator.rb
impressionist-1.4.13 lib/generators/active_record/impressionist_generator.rb
impressionist-1.4.12 lib/generators/active_record/impressionist_generator.rb
impressionist-1.4.11 lib/generators/active_record/impressionist_generator.rb
impressionist-1.4.10 lib/generators/active_record/impressionist_generator.rb
impressionist-1.4.9 lib/generators/active_record/impressionist_generator.rb
impressionist-1.4.8 lib/generators/active_record/impressionist_generator.rb
impressionist-1.4.7 lib/generators/active_record/impressionist_generator.rb
impressionist-1.4.6 lib/generators/active_record/impressionist_generator.rb
impressionist-1.4.5 lib/generators/active_record/impressionist_generator.rb
impressionist-1.4.4 lib/generators/active_record/impressionist_generator.rb
impressionist-1.4.3 lib/generators/active_record/impressionist_generator.rb