Class: ActiveRecord::Generators::OproGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/active_record/opro_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/generators/active_record/opro_generator.rb', line 12

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

Instance Method Details

#copy_migrationsObject



22
23
24
25
# File 'lib/generators/active_record/opro_generator.rb', line 22

def copy_migrations
  migration_template "auth_grants.rb", "db/migrate/create_opro_auth_grants.rb"
  migration_template "client_apps.rb", "db/migrate/create_opro_client_apps.rb"
end