Sha256: 2dcfb698b4fc467a53791687423f45a67f1f490fe19f81165d7605bbe5bfe3e0

Contents?: true

Size: 853 Bytes

Versions: 59

Compression:

Stored size: 853 Bytes

Contents

module EffectiveEvents
  module Generators
    class InstallGenerator < Rails::Generators::Base
      include Rails::Generators::Migration

      desc 'Creates an EffectiveEvents initializer in your application.'

      source_root File.expand_path('../../templates', __FILE__)

      def self.next_migration_number(dirname)
        if not ActiveRecord::Base.timestamped_migrations
          Time.new.utc.strftime("%Y%m%d%H%M%S")
        else
          '%.3d' % (current_migration_number(dirname) + 1)
        end
      end

      def copy_initializer
        template ('../' * 3) + 'config/effective_events.rb', 'config/initializers/effective_events.rb'
      end

      def create_migration_file
        migration_template ('../' * 3) + 'db/migrate/101_create_effective_events.rb', 'db/migrate/create_effective_events.rb'
      end

    end
  end
end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
effective_events-0.20.6 lib/generators/effective_events/install_generator.rb
effective_events-0.20.5 lib/generators/effective_events/install_generator.rb
effective_events-0.20.4 lib/generators/effective_events/install_generator.rb
effective_events-0.20.3 lib/generators/effective_events/install_generator.rb
effective_events-0.20.2 lib/generators/effective_events/install_generator.rb
effective_events-0.20.1 lib/generators/effective_events/install_generator.rb
effective_events-0.20.0 lib/generators/effective_events/install_generator.rb
effective_events-0.19.2 lib/generators/effective_events/install_generator.rb
effective_events-0.19.1 lib/generators/effective_events/install_generator.rb
effective_events-0.19.0 lib/generators/effective_events/install_generator.rb
effective_events-0.18.2 lib/generators/effective_events/install_generator.rb
effective_events-0.18.1 lib/generators/effective_events/install_generator.rb
effective_events-0.18.0 lib/generators/effective_events/install_generator.rb
effective_events-0.17.0 lib/generators/effective_events/install_generator.rb
effective_events-0.16.0 lib/generators/effective_events/install_generator.rb
effective_events-0.15.1 lib/generators/effective_events/install_generator.rb
effective_events-0.15.0 lib/generators/effective_events/install_generator.rb
effective_events-0.14.2 lib/generators/effective_events/install_generator.rb
effective_events-0.14.1 lib/generators/effective_events/install_generator.rb
effective_events-0.14.0 lib/generators/effective_events/install_generator.rb