Sha256: 1ef3bfe659137cfd935c61b98f6ecf599eaef70546f4d72330c7b490c6eaca1d

Contents?: true

Size: 729 Bytes

Versions: 37

Compression:

Stored size: 729 Bytes

Contents

require 'rails/generators'
require 'rails/generators/migration'
require 'rails/generators/active_record'

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

    source_root File.expand_path('../templates', __FILE__)
    desc 'Generates (but does not run) a migration to add an imports table.'

    def create_migration_file
      migration_template 'create_imports_migration.rb', 'db/migrate/create_imports.rb'
    end

    def create_initializer_file
      copy_file 'initializer.rb', 'config/initializers/synchronisable.rb'
    end

    def self.next_migration_number(dirname)
      ActiveRecord::Generators::Base.next_migration_number(dirname)
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
synchronisable-1.3.1 lib/generators/synchronisable/install_generator.rb
synchronisable-1.3.0 lib/generators/synchronisable/install_generator.rb
synchronisable-1.2.7 lib/generators/synchronisable/install_generator.rb
synchronisable-1.2.6 lib/generators/synchronisable/install_generator.rb
synchronisable-1.2.5 lib/generators/synchronisable/install_generator.rb
synchronisable-1.2.4 lib/generators/synchronisable/install_generator.rb
synchronisable-1.2.3 lib/generators/synchronisable/install_generator.rb
synchronisable-1.2.2 lib/generators/synchronisable/install_generator.rb
synchronisable-1.2.1 lib/generators/synchronisable/install_generator.rb
synchronisable-1.2.0 lib/generators/synchronisable/install_generator.rb
synchronisable-1.1.9 lib/generators/synchronisable/install_generator.rb
synchronisable-1.1.8 lib/generators/synchronisable/install_generator.rb
synchronisable-1.1.7 lib/generators/synchronisable/install_generator.rb
synchronisable-1.1.6 lib/generators/synchronisable/install_generator.rb
synchronisable-1.1.5 lib/generators/synchronisable/install_generator.rb
synchronisable-1.1.4 lib/generators/synchronisable/install_generator.rb
synchronisable-1.1.3 lib/generators/synchronisable/install_generator.rb
synchronisable-1.1.2 lib/generators/synchronisable/install_generator.rb
synchronisable-1.1.1 lib/generators/synchronisable/install_generator.rb
synchronisable-1.1.0 lib/generators/synchronisable/install_generator.rb