Class: ActiveAdmin::Cms::RecipeGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- ActiveAdmin::Cms::RecipeGenerator
- 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_root ⇒ Object
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.("../templates", __FILE__) end |
Instance Method Details
#create_model ⇒ Object
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 |