Sha256: 0f7dbe898bce28e3e6f109bf70ac0af0e9b4934daaf0ec1574ffc55ffbfe4e16

Contents?: true

Size: 845 Bytes

Versions: 20

Compression:

Stored size: 845 Bytes

Contents

# Requires
require 'rails/generators'
require 'rails/generators/migration'

class SoapboxMigrationGenerator < Rails::Generators::Base
  include Rails::Generators::Migration
  def self.source_root
    @source_root ||= File.join(File.dirname(__FILE__), 'templates')
  end

  def self.next_migration_number(dirname)
    if ActiveRecord::Base.timestamped_migrations
      Time.new.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_soapbox_tables.rb'    
    puts "make sure to run - rake db:migrate"
    puts "you'll also want to add a super admin so you can login to /admin"
    puts "rails c"
    puts 'User.create(:email => "your@email.address", :password => "xxxxxx", :super_admin => true)'
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
soapbox-0.3.1 lib/generators/soapbox_migration/soapbox_migration_generator.rb
soapbox-0.3.0 lib/generators/soapbox_migration/soapbox_migration_generator.rb
soapbox-0.2.24 lib/generators/soapbox_migration/soapbox_migration_generator.rb
soapbox-0.2.23 lib/generators/soapbox_migration/soapbox_migration_generator.rb
soapbox-0.2.21 lib/generators/soapbox_migration/soapbox_migration_generator.rb
soapbox-0.2.20 lib/generators/soapbox_migration/soapbox_migration_generator.rb
soapbox-0.2.18 lib/generators/soapbox_migration/soapbox_migration_generator.rb
soapbox-0.2.16 lib/generators/soapbox_migration/soapbox_migration_generator.rb
soapbox-0.2.15 lib/generators/soapbox_migration/soapbox_migration_generator.rb
soapbox-0.2.14 lib/generators/soapbox_migration/soapbox_migration_generator.rb
soapbox-0.2.12 lib/generators/soapbox_migration/soapbox_migration_generator.rb
soapbox-0.2.11 lib/generators/soapbox_migration/soapbox_migration_generator.rb
soapbox-0.2.10 lib/generators/soapbox_migration/soapbox_migration_generator.rb
soapbox-0.2.9 lib/generators/soapbox_migration/soapbox_migration_generator.rb
soapbox-0.2.8 lib/generators/soapbox_migration/soapbox_migration_generator.rb
soapbox-0.2.7 lib/generators/soapbox_migration/soapbox_migration_generator.rb
soapbox-0.2.6 lib/generators/soapbox_migration/soapbox_migration_generator.rb
soapbox-0.2.5 lib/generators/soapbox_migration/soapbox_migration_generator.rb
soapbox-0.2.4 lib/generators/soapbox_migration/soapbox_migration_generator.rb
soapbox-0.2.3 lib/generators/soapbox_migration/soapbox_migration_generator.rb