Sha256: 3354c86bce3aba29fc4787a436f69d60867e1c591244f31cb57374281f3cbae8

Contents?: true

Size: 651 Bytes

Versions: 1

Compression:

Stored size: 651 Bytes

Contents

require 'rails/generators'
require 'rails/generators/migration'     

module SocialEngine
  class UserReputationGenerator < Rails::Generators::Base
    include Rails::Generators::Migration
    source_root File.join(File.dirname(__FILE__), 'templates')

    def self.next_migration_number(dirname)
      sleep 1
      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 'add_reputation_to_users_table.rb', 'db/migrate/add_reputation_to_users_table.rb'  
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
social_engine-0.0.1 lib/generators/social_engine/user_reputation/user_reputation_generator.rb