Sha256: 58c88ecc28f75190bb28164684ee6a830c81b881857fd4938f4c4764f89a7b4e
Contents?: true
Size: 703 Bytes
Versions: 15
Compression:
Stored size: 703 Bytes
Contents
Merb::Generators::ModelGenerator.option :migration, :as => :boolean, :desc => 'Also generate a dm-migration for the model' 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 STDOUT << message("Don't forget to define the model schema in your #{file_name.capitalize} class") 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
15 entries across 15 versions & 1 rubygems