Class: WardenOauthProvider::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- WardenOauthProvider::InstallGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/warden_oauth_provider/install/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(dirname) ⇒ Object
:nodoc:
12 13 14 15 16 17 18 19 |
# File 'lib/generators/warden_oauth_provider/install/install_generator.rb', line 12 def self.next_migration_number(dirname) #:nodoc: next_migration_number = current_migration_number(dirname) + 1 if ActiveRecord::Base. [Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % next_migration_number].max else "%.3d" % next_migration_number end end |
.source_root ⇒ Object
8 9 10 |
# File 'lib/generators/warden_oauth_provider/install/install_generator.rb', line 8 def self.source_root @source_root ||= File.join(File.dirname(__FILE__), 'templates') end |
Instance Method Details
#create_migration_file ⇒ Object
21 22 23 24 25 |
# File 'lib/generators/warden_oauth_provider/install/install_generator.rb', line 21 def create_migration_file if defined?(ActiveRecord) migration_template 'migration.rb', 'db/migrate/create_oauth_tables.rb' end end |