Class: Merb::Generators::ModelGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/data_mapper_model.rb

Instance Method Summary collapse

Instance Method Details

#after_generationObject



9
10
11
12
13
# File 'lib/generators/data_mapper_model.rb', line 9

def after_generation
  if orm == :datamapper
    STDOUT << message("Don't forget to define the model schema in your #{ Extlib::Inflection.camelize(file_name) } class")
  end
end

#datamapper_type(type) ⇒ Object

Corrects case of common datamapper arguments.



4
5
6
7
# File 'lib/generators/data_mapper_model.rb', line 4

def datamapper_type(type)
  return 'DateTime' if type == 'datetime'
  return type.camel_case
end