Class: ActsAsOauthAccessibleGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



11
12
13
# File 'lib/generators/acts_as_oauth_accessible_generator.rb', line 11

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

.source_rootObject



7
8
9
# File 'lib/generators/acts_as_oauth_accessible_generator.rb', line 7

def self.source_root
  @source_root ||= File.expand_path('../templates', __FILE__)
end

Instance Method Details

#copy_config_filesObject



15
16
17
# File 'lib/generators/acts_as_oauth_accessible_generator.rb', line 15

def copy_config_files
  copy_file('config/oauth_providers.yml', 'config/oauth_providers.yml')
end

#copy_migration_fileObject



23
24
25
# File 'lib/generators/acts_as_oauth_accessible_generator.rb', line 23

def copy_migration_file
  migration_template 'db/migration.rb', 'db/migrate/create_consumer_tokens'
end

#copy_modelsObject



19
20
21
# File 'lib/generators/acts_as_oauth_accessible_generator.rb', line 19

def copy_models
  template 'models/consumer_token.rb', 'app/models/consumer_token.rb'
end