Sha256: fb15d7fd9fb5c8866ebd0434defd10cad024873949326ec9cd9334793f55beb4

Contents?: true

Size: 628 Bytes

Versions: 5

Compression:

Stored size: 628 Bytes

Contents

module LolitaMenu
  module Generators
    class InstallGenerator < Rails::Generators::Base
      include Lolita::Generators::FileHelper
      source_root File.expand_path("../templates", __FILE__)
      desc "Copy assets and create migrations. "


      def copy_assets
        generate("lolita_menu:assets")
      end

      def copy_migration
        copy_file "migrations/create_menus.rb", "db/migrate/#{Time.now.strftime("%Y%m%d%H%M%S")}_create_lolita_menus.rb"
        copy_file "migrations/create_menu_items.rb", "db/migrate/#{(Time.now+1).strftime("%Y%m%d%H%M%S")}_create_lolita_menu_items.rb"
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lolita-menu-0.0.11 lib/generators/lolita_menu/install_generator.rb
lolita-menu-0.0.10 lib/generators/lolita_menu/install_generator.rb
lolita-menu-0.0.9 lib/generators/lolita_menu/install_generator.rb
lolita-menu-0.0.8 lib/generators/lolita_menu/install_generator.rb
lolita-menu-0.0.6 lib/generators/lolita_menu/install_generator.rb