Sha256: 233f02849c2520810318e59abe7ff34fa4d0182c82c6c0b7d4cf7657bbcee8ef

Contents?: true

Size: 608 Bytes

Versions: 19

Compression:

Stored size: 608 Bytes

Contents

module Headmin
  class BlocksGenerator < Rails::Generators::Base
    include Rails::Generators::Migration

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

    def copy_models
      template "models/block.rb", "app/models/block.rb"
    end

    def copy_migrations
      migration_template "migrations/create_blocks.rb", "db/migrate/create_blocks.rb"
    end

    class << self
      def next_migration_number(dirname)
        next_migration_number = current_migration_number(dirname) + 1
        ActiveRecord::Migration.next_migration_number(next_migration_number)
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
headmin-0.6.3 lib/generators/headmin/blocks_generator.rb
headmin-0.6.2 lib/generators/headmin/blocks_generator.rb
headmin-0.6.1 lib/generators/headmin/blocks_generator.rb
headmin-0.6.0 lib/generators/headmin/blocks_generator.rb
headmin-0.5.9 lib/generators/headmin/blocks_generator.rb
headmin-0.5.8 lib/generators/headmin/blocks_generator.rb
headmin-0.5.7 lib/generators/headmin/blocks_generator.rb
headmin-0.5.6 lib/generators/headmin/blocks_generator.rb
headmin-0.5.5 lib/generators/headmin/blocks_generator.rb
headmin-0.5.4 lib/generators/headmin/blocks_generator.rb
headmin-0.5.3 lib/generators/headmin/blocks_generator.rb
headmin-0.5.2 lib/generators/headmin/blocks_generator.rb
headmin-0.5.1 lib/generators/headmin/blocks_generator.rb
headmin-0.5.0 lib/generators/headmin/blocks_generator.rb
headmin-0.4.2 lib/generators/headmin/blocks_generator.rb
headmin-0.4.1 lib/generators/headmin/blocks_generator.rb
headmin-0.4.0 lib/generators/headmin/blocks_generator.rb
headmin-0.3.4 lib/generators/headmin/blocks_generator.rb
headmin-0.3.3 lib/generators/headmin/blocks_generator.rb