Sha256: 9be3d84cdc80cf03fab1a07f5f3cc0b13cd13b2d7b25186eea7486fc647472dd

Contents?: true

Size: 634 Bytes

Versions: 9

Compression:

Stored size: 634 Bytes

Contents

class Merb::Generators::ModelGenerator
  ##
  # Corrects case of common datamapper arguments.
  def datamapper_type(type)
    return 'DateTime' if type == 'datetime'
    return type.camel_case
  end
  
  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
  
end

Merb::Generators::ModelGenerator.template :model_datamapper, :orm => :datamapper do |t|
  t.source = File.join(File.dirname(__FILE__), "templates", "model.rb")
  t.destination = File.join("app/models", base_path, "#{file_name}.rb")
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
merb_datamapper-1.1.3 lib/generators/data_mapper_model.rb
merb_datamapper-1.1.2 lib/generators/data_mapper_model.rb
merb_datamapper-1.1.1 lib/generators/data_mapper_model.rb
merb_datamapper-1.1.0 lib/generators/data_mapper_model.rb
merb_datamapper-1.1.0.rc1 lib/generators/data_mapper_model.rb
merb_datamapper-1.1.0.pre lib/generators/data_mapper_model.rb
merb_datamapper-1.0.15 lib/generators/data_mapper_model.rb
merb_datamapper-1.0.14 lib/generators/data_mapper_model.rb
merb_datamapper-1.0.13 lib/generators/data_mapper_model.rb