Class: DeviseYauthTokenGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object



13
14
15
16
17
18
# File 'lib/generators/devise_yauth_token/devise_yauth_token_generator.rb', line 13

def self.next_migration_number(dirname)
  #if ActiveRecord::Base.timestamped_migrations
    Time.now.utc.strftime("%Y%m%d%H%M%S")
    "%.3d" % (current_migration_number(dirname) + 1)
  #end
end

.source_rootObject



8
9
10
# File 'lib/generators/devise_yauth_token/devise_yauth_token_generator.rb', line 8

def self.source_root
  @source_root ||= File.join(File.dirname(__FILE__), 'templates')
end

Instance Method Details

#create_migration_fileObject



20
21
22
23
24
25
26
27
28
# File 'lib/generators/devise_yauth_token/devise_yauth_token_generator.rb', line 20

def create_migration_file
  migration_template 'create_accounts.rb', 'db/migrate/create_accounts.rb'
  migration_template 'create_account_hosts.rb', 'db/migrate/create_account_hosts.rb'
  migration_template 'add_columns_to_users.rb', 'db/migrate/add_columns_to_users.rb'
  template 'account.rb', 'app/models/account.rb'
  template 'account_host.rb', 'app/models/account_host.rb'
  template 'eagle.rb', 'config/initializers/eagle.rb'
  template 'eagle.yml', 'config/eagle.yml'
end