Sha256: b4f9a807fff15649767f224b16ccdc1062c217f25fa96511ebe0d605e9efd724

Contents?: true

Size: 772 Bytes

Versions: 11

Compression:

Stored size: 772 Bytes

Contents

# lib/generators/plutus/plutus_generator.rb
require 'rails/generators'
require 'rails/generators/migration'

class PlutusGenerator < Rails::Generators::Base
 include Rails::Generators::Migration

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

 # Implement the required interface for Rails::Generators::Migration.
 # taken from http://github.com/rails/rails/blob/master/activerecord/lib/generators/active_record.rb
 def self.next_migration_number(dirname)
	 if ActiveRecord::Base.timestamped_migrations
		 Time.now.utc.strftime("%Y%m%d%H%M%S")
	 else
		 "%.3d" % (current_migration_number(dirname) + 1)
	 end
 end

 def create_migration_file
	 migration_template 'migration.rb', 'db/migrate/create_plutus_tables.rb'
 end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
plutus-0.11.0 lib/generators/plutus/plutus_generator.rb
plutus-0.10.1 lib/generators/plutus/plutus_generator.rb
plutus-0.10.0 lib/generators/plutus/plutus_generator.rb
plutus-0.9.0 lib/generators/plutus/plutus_generator.rb
plutus-0.8.1 lib/generators/plutus/plutus_generator.rb
plutus-0.8.0 lib/generators/plutus/plutus_generator.rb
plutus-0.7.4 lib/generators/plutus/plutus_generator.rb
plutus-0.7.2 lib/generators/plutus/plutus_generator.rb
plutus-0.7.0 lib/generators/plutus/plutus_generator.rb
plutus-0.5.2 lib/generators/plutus/plutus_generator.rb
plutus-0.5.1 lib/generators/plutus/plutus_generator.rb