Class: Parrot::Generators::ParrotGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Parrot::Generators::ParrotGenerator
- Defined in:
- lib/generators/parrot/parrot_generator.rb
Instance Method Summary collapse
Instance Method Details
#inject_parrot_content ⇒ Object
14 15 16 |
# File 'lib/generators/parrot/parrot_generator.rb', line 14 def inject_parrot_content inject_into_class(model_path, class_name, " parrot_comments\n\n") if model_exists? end |
#model_exists? ⇒ Boolean
6 7 8 |
# File 'lib/generators/parrot/parrot_generator.rb', line 6 def model_exists? File.exists?(File.join(destination_root, model_path)) end |
#model_path ⇒ Object
10 11 12 |
# File 'lib/generators/parrot/parrot_generator.rb', line 10 def model_path @model_path ||= File.join("app", "models", "#{file_path}.rb") end |