Sha256: ad89e624cccbced34f0319c010ea69e2ea6cc694561d9d77b6c26904e59bfc05
Contents?: true
Size: 754 Bytes
Versions: 30
Compression:
Stored size: 754 Bytes
Contents
# encoding: utf-8 require "rails/generators/mongoid_generator" module Mongoid #:nodoc: module Generators #:nodoc: class ModelGenerator < Base #:nodoc: desc "Creates a Mongoid model" 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" class_option :versioning, :type => :boolean, :default => false, :desc => "Enable mongoid versioning" 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
30 entries across 30 versions & 5 rubygems