Sha256: 887617f41666f90da20f13f0392158d072ee8d37c499854facb9abe1de59574e

Contents?: true

Size: 604 Bytes

Versions: 24

Compression:

Stored size: 604 Bytes

Contents

require 'rails/generators/couchrest_model'

module CouchrestModel
  module Generators
    class ModelGenerator < Base
      check_class_collision

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

      def create_module_file
        return if class_path.empty?
        template 'module.rb', File.join('app/models', "#{class_path.join('/')}.rb") if behavior == :invoke
      end
      
      hook_for :test_framework

      protected

        def parent_class_name
          "CouchRest::Model::Base"
        end

    end
  end
end

Version data entries

24 entries across 24 versions & 3 rubygems

Version Path
couchrest_model-2.2.0.beta2 lib/rails/generators/couchrest_model/model/model_generator.rb
couchrest_model-2.2.0.beta1 lib/rails/generators/couchrest_model/model/model_generator.rb
couchrest_model-2.1.0.rc1 lib/rails/generators/couchrest_model/model/model_generator.rb
couchrest_model-2.1.0.beta2 lib/rails/generators/couchrest_model/model/model_generator.rb
couchrest_model-2.1.0.beta1 lib/rails/generators/couchrest_model/model/model_generator.rb
couchrest_model-2.0.4 lib/rails/generators/couchrest_model/model/model_generator.rb
couchrest_model-2.0.3 lib/rails/generators/couchrest_model/model/model_generator.rb
couchrest_model-2.0.1 lib/rails/generators/couchrest_model/model/model_generator.rb
couchrest_model-2.0.0 lib/rails/generators/couchrest_model/model/model_generator.rb
couchrest_model-2.0.0.beta2 lib/rails/generators/couchrest_model/model/model_generator.rb
couchrest_model-2.0.0.beta lib/rails/generators/couchrest_model/model/model_generator.rb
couchrest_model-1.2.0.beta lib/rails/generators/couchrest_model/model/model_generator.rb
openlogic-couchrest_model-1.0.0 lib/rails/generators/couchrest_model/model/model_generator.rb
couchrest_model-1.1.2 lib/rails/generators/couchrest_model/model/model_generator.rb
couchrest_model-1.1.1 lib/rails/generators/couchrest_model/model/model_generator.rb
couchrest_model-1.1.0 lib/rails/generators/couchrest_model/model/model_generator.rb
couchrest_model-1.1.0.rc1 lib/rails/generators/couchrest_model/model/model_generator.rb
couchrest_model-1.1.0.beta5 lib/rails/generators/couchrest_model/model/model_generator.rb
couchrest_model-1.1.0.beta4 lib/rails/generators/couchrest_model/model/model_generator.rb
couchrest_model-1.1.0.beta3 lib/rails/generators/couchrest_model/model/model_generator.rb