Sha256: 3b6d1e37a50586f9bf3ea78a5bb901f7a9841c8b5d4caf11a01c906fb036140b

Contents?: true

Size: 608 Bytes

Versions: 1

Compression:

Stored size: 608 Bytes

Contents

class CaerbannogGenerator < Rails::Generators::Base
  include Rails::Generators::Migration
  source_root File.expand_path('../templates', __FILE__)
  
  def self.next_migration_number(path)
    Time.now.utc.strftime("%Y%m%d%H%M%S")
  end

  def copy_migration
    migration_template "add_caerbannog_messages.rb", "db/migrate/add_caerbannog_messages.rb"
  end

  def create_message_model
    copy_file "caerbannog_message.rb", "app/models/caerbannog_message.rb"
  end

  def create_caerbannog_initializer
    copy_file "caerbannog_initializer.rb", "config/initializers/caerbannog_initializer.rb"
  end
end
  

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
caerbannog-0.1.0 lib/generators/caerbannog_generator.rb