Sha256: 6b1f2c593bf697d7d60a784d07dbced8dce342da7d3013a5d10fa4b5ef85fdb5

Contents?: true

Size: 576 Bytes

Versions: 7

Compression:

Stored size: 576 Bytes

Contents

require 'rails/generators/active_record'

module ActiveRecord
  module Generators
    class SimonSaysGenerator < ActiveRecord::Generators::Base
      source_root File.expand_path("../templates", __FILE__)

      def copy_simon_says_migration
        migration_template "migration.rb", "db/migrate/simon_says_add_to_#{table_name}.rb"
      end

      private

      def migration_version
        "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]" if Rails.version >= '5.0.0'
      end

      def role_attribute_name
        args.first || 'roles'
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
simon_says-0.3.0.alpha.7 lib/generators/active_record/simon_says_generator.rb
simon_says-0.3.0.alpha.6 lib/generators/active_record/simon_says_generator.rb
simon_says-0.3.0.alpha.5 lib/generators/active_record/simon_says_generator.rb
simon_says-0.3.0.alpha.4 lib/generators/active_record/simon_says_generator.rb
simon_says-0.3.0.alpha.3 lib/generators/active_record/simon_says_generator.rb
simon_says-0.3.0.alpha.1 lib/generators/active_record/simon_says_generator.rb
simon_says-0.2.0 lib/generators/active_record/simon_says_generator.rb