Sha256: 2a7f7eb554506ccc6deb926bf3396e9f7856efae5d770c25ded96e9a6e0734af

Contents?: true

Size: 770 Bytes

Versions: 2

Compression:

Stored size: 770 Bytes

Contents

require 'rails/generators/ripple_generator'

module Ripple
  module Generators
    class ModelGenerator < NamedBase
      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 & 2 rubygems

Version Path
seomoz-ripple-1.0.0.pre lib/rails/generators/ripple/model/model_generator.rb
ripple-1.0.0.beta lib/rails/generators/ripple/model/model_generator.rb