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
ardm-rails-1.3.1 lib/generators/data_mapper/model/model_generator.rb
ardm-rails-1.3.0 lib/generators/data_mapper/model/model_generator.rb
ardm-rails-1.2.1 lib/generators/data_mapper/model/model_generator.rb
tpitale-dm-rails-1.3.0 lib/generators/data_mapper/model/model_generator.rb
tpitale-dm-rails-1.2.2 lib/generators/data_mapper/model/model_generator.rb
dm-rails-1.2.1 lib/generators/data_mapper/model/model_generator.rb
tpitale-dm-rails-1.2.1 lib/generators/data_mapper/model/model_generator.rb
dm-rails-1.2.0 lib/generators/data_mapper/model/model_generator.rb
dm-rails-1.2.0.rc2 lib/generators/data_mapper/model/model_generator.rb
dm-rails-1.2.0.rc1 lib/generators/data_mapper/model/model_generator.rb
dm-rails-1.1.0 lib/generators/data_mapper/model/model_generator.rb
dm-rails-1.1.0.rc3 lib/generators/data_mapper/model/model_generator.rb
dm-rails-1.1.0.rc2 lib/generators/data_mapper/model/model_generator.rb
dm-rails-1.1.0.rc1 lib/generators/data_mapper/model/model_generator.rb
dm-rails-1.0.4 lib/generators/data_mapper/model/model_generator.rb
dm-rails-1.0.3 lib/generators/data_mapper/model/model_generator.rb
dm-rails-1.0.2 lib/generators/data_mapper/model/model_generator.rb
dm-rails-1.0.1 lib/generators/data_mapper/model/model_generator.rb
dm-rails-1.0.0 lib/generators/data_mapper/model/model_generator.rb
dm-rails-1.0.0.rc3 lib/generators/data_mapper/model/model_generator.rb