Sha256: fdda797a0485924f5ad460530a0f66b14e575183973a457eae8d04702db17cc3

Contents?: true

Size: 727 Bytes

Versions: 15

Compression:

Stored size: 727 Bytes

Contents

require 'rails/generators/active_record'

module Merit
  module Generators::ActiveRecord
    class MeritGenerator < ::ActiveRecord::Generators::Base
      include Rails::Generators::Migration

      source_root File.expand_path('../templates', __FILE__)
      desc 'add active_record merit migrations'

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

      def copy_migrations_and_model
        migration_template 'add_merit_fields_to_model.erb',
                            "db/migrate/add_merit_fields_to_#{table_name}.rb"
      end

      def migration_version
        "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
qalam_merit-4.5.12 lib/merit/generators/active_record/merit_generator.rb
qalam_merit-4.5.11 lib/merit/generators/active_record/merit_generator.rb
qalam_merit-4.5.10 lib/merit/generators/active_record/merit_generator.rb
qalam_merit-4.5.09 lib/merit/generators/active_record/merit_generator.rb
qalam_merit-4.5.08 lib/merit/generators/active_record/merit_generator.rb
qalam_merit-4.5.07 lib/merit/generators/active_record/merit_generator.rb
qalam_merit-4.5.06 lib/merit/generators/active_record/merit_generator.rb
qalam_merit-4.5.05 lib/merit/generators/active_record/merit_generator.rb
qalam_merit-4.5.04 lib/merit/generators/active_record/merit_generator.rb
qalam_merit-4.5.03 lib/merit/generators/active_record/merit_generator.rb
qalam_merit-4.5.02 lib/merit/generators/active_record/merit_generator.rb
qalam_merit-4.5.01 lib/merit/generators/active_record/merit_generator.rb
qalam_merit-4.5.00 lib/merit/generators/active_record/merit_generator.rb
qalam_merit-4.0.4 lib/merit/generators/active_record/merit_generator.rb
qalam_merit-4.0.35 lib/merit/generators/active_record/merit_generator.rb