Sha256: cdad17d75b88782eba2f48915c5bfd594b8cf58adb49b376cfcacc63d3732b18

Contents?: true

Size: 702 Bytes

Versions: 11

Compression:

Stored size: 702 Bytes

Contents

# frozen_string_literal: true
require 'rails/generators/active_record'

module Monarchy
  class SetupGenerator < Rails::Generators::Base
    include Rails::Generators::Migration

    desc 'This generator setups Monarchy'
    source_root File.expand_path('../../templates', __FILE__)

    def setup_monarchy
      template 'config.rb', 'config/initializers/monarchy.rb'

      migration_template 'migrations/hierarchy.rb', 'db/migrate/monarchy_create_hierarchies.rb'
      migration_template 'migrations/membership.rb', 'db/migrate/monarchy_create_memberships.rb'
    end

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
monarchy-2.1.0 lib/generators/monarchy/setup_generator.rb
monarchy-2.0.8 lib/generators/monarchy/setup_generator.rb
monarchy-2.0.7 lib/generators/monarchy/setup_generator.rb
monarchy-2.0.6 lib/generators/monarchy/setup_generator.rb
monarchy-2.0.5 lib/generators/monarchy/setup_generator.rb
monarchy-2.0.4 lib/generators/monarchy/setup_generator.rb
monarchy-2.0.0.pre.beta.1 lib/generators/monarchy/setup_generator.rb
monarchy-1.1.5 lib/generators/monarchy/setup_generator.rb
monarchy-1.1.4 lib/generators/monarchy/setup_generator.rb
monarchy-1.1.3 lib/generators/monarchy/setup_generator.rb
monarchy-1.0.0 lib/generators/monarchy/setup_generator.rb