Sha256: f0fbb82702f4dd2d6ba3e8f37d6c4392b71e308f4cb60ad67f0b102c3a2f437c

Contents?: true

Size: 558 Bytes

Versions: 22

Compression:

Stored size: 558 Bytes

Contents

require 'generators/data_mapper'

module DataMapper
  module Generators

    class ModelGenerator < Base
      argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"

      check_class_collision

      class_option :timestamps, :type => :boolean
      class_option :parent,     :type => :string, :desc => "The parent class for the generated model"

      def create_model_file
        template 'model.rb', File.join('app/models', class_path, "#{file_name}.rb")
      end

      hook_for :test_framework

    end

  end
end

Version data entries

22 entries across 22 versions & 3 rubygems

Version Path
dm-rails-1.0.0.rc2 lib/generators/data_mapper/model/model_generator.rb
dm-rails-1.0.0.rc1 lib/generators/data_mapper/model/model_generator.rb