Class: Merb::Generators::ModelGenerator
- Inherits:
-
NamespacedGenerator
- Object
- Templater::Generator
- Generator
- NamedGenerator
- NamespacedGenerator
- Merb::Generators::ModelGenerator
- Defined in:
- lib/generators/model.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from NamespacedGenerator
#base_path, #class_name, #file_name, #full_class_name, #modules
Methods inherited from NamedGenerator
#class_name, #file_name, #initialize, #symbol_name, #test_class_name
Methods inherited from Generator
#go_up, #initialize, #with_modules
Methods included from ColorfulMessages
Constructor Details
This class inherits a constructor from Merb::Generators::NamedGenerator
Class Method Details
.source_root ⇒ Object
6 7 8 |
# File 'lib/generators/model.rb', line 6 def self.source_root File.join(super, 'component', 'model') end |
Instance Method Details
#after_generation ⇒ Object
44 45 46 |
# File 'lib/generators/model.rb', line 44 def after_generation STDOUT.puts "\n\nDon't forget to add model tests first." end |
#attributes? ⇒ Boolean
36 37 38 |
# File 'lib/generators/model.rb', line 36 def attributes? self.attributes && !self.attributes.empty? end |
#attributes_for_accessor ⇒ Object
40 41 42 |
# File 'lib/generators/model.rb', line 40 def attributes_for_accessor self.attributes.keys.map{|a| ":#{a}" }.compact.uniq.join(", ") end |