Sha256: 8aabeea41890f1087dbe64bfa4c93eb44faa525e2687e4a92eda781b500533bb

Contents?: true

Size: 516 Bytes

Versions: 1

Compression:

Stored size: 516 Bytes

Contents

require 'rails/generators'

class SanteyVoteGenerator < Rails::Generators::Base
  include Rails::Generators::Migration
  
  def self.source_root
    @source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
  end
  
  def self.next_migration_number(dirname)
    Time.now.strftime("%Y%m%d%H%M%S")
  end
  
  # copy migrations to db/migrate
  def install_migrations
    migration_template "migrations/create_votes.rb", File.join('db/migrate', "create_votes.rb")
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
santey_vote-0.1.1 lib/generators/santey_vote_generator.rb