Sha256: 64cdbd6ca20eead521c349da941d775e1f0b7cbd8c9540ea4b16acee870938bd

Contents?: true

Size: 773 Bytes

Versions: 4

Compression:

Stored size: 773 Bytes

Contents

require 'rails/generators/migration'


module ActiveRecord
  module Generators
    class OproGenerator < ::Rails::Generators::Base
      include Rails::Generators::Migration
      source_root File.expand_path('../templates', __FILE__)

      desc "add the migrations"

      def self.next_migration_number(path)
        unless @prev_migration_nr
          @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
        else
          @prev_migration_nr += 1
        end
        @prev_migration_nr.to_s
      end


      def copy_migrations
        migration_template "access_grants.rb",       "db/migrate/create_opro_access_grants.rb"
        migration_template "client_applications.rb", "db/migrate/create_opro_client_applications.rb"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
opro-0.0.1 lib/generators/active_record/opro_generator.rb
opro-0.0.1.pre1.0.2 lib/generators/active_record/opro_generator.rb
opro-0.0.1.pre1.0.1 lib/generators/active_record/opro_generator.rb
opro-0.0.1.pre lib/generators/active_record/opro_generator.rb