Class: ActiveAdmin::Cms::RecipeGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/active_admin/cms/recipe/recipe_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object



8
9
10
# File 'lib/generators/active_admin/cms/recipe/recipe_generator.rb', line 8

def self.next_migration_number(dirname)
  Time.now.strftime("%Y%m%d%H%M%S")
end

.source_rootObject



12
13
14
# File 'lib/generators/active_admin/cms/recipe/recipe_generator.rb', line 12

def self.source_root
  @_active_admin_cms_source_root ||= File.expand_path("../templates", __FILE__)
end

Instance Method Details

#create_modelObject

end



20
21
22
# File 'lib/generators/active_admin/cms/recipe/recipe_generator.rb', line 20

def create_model
  template 'recipe.rb.erb', "app/models/recipes/#{file_path}.rb"
end