Sha256: 5bb3eea2f6929535c00a284b4b8e19ad161a3311a5e5ec8ab8a2e3736891ea55

Contents?: true

Size: 765 Bytes

Versions: 2

Compression:

Stored size: 765 Bytes

Contents

require 'rails/generators/ripple_generator'

module Ripple
  module Generators
    class ModelGenerator < Base
      desc 'Creates a ripple model'
      argument :attributes, :type => :array, :default => [], :banner => 'field:type field:type'
      class_option :parent, :type => :string, :desc => "The parent class for the generated model"
      class_option :embedded, :type => :boolean, :desc => "Make an embedded document model.", :default => false
      class_option :embedded_in, :type => :string, :desc => "Specify the enclosing model for the embedded document. Implies --embedded."
      check_class_collision

      def create_model_file
        template 'model.rb', "app/models/#{file_path}.rb"
      end

      hook_for :test_framework
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ripple-0.8.0.beta2 lib/rails/generators/ripple/model/model_generator.rb
ripple-0.8.0.beta lib/rails/generators/ripple/model/model_generator.rb