Sha256: ce669cae3fa5eaaf829a3e1d288cb5cbe365e538b8736da19d3875f61830ddc7
Contents?: true
Size: 705 Bytes
Versions: 69
Compression:
Stored size: 705 Bytes
Contents
# encoding: utf-8 require "rails/generators/mongoid_generator" module Mongoid module Generators class ModelGenerator < Base 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 :collection, type: :string, desc: "The collection for storing model's documents" def create_model_file template "model.rb.tt", File.join("app/models", class_path, "#{file_name}.rb") end hook_for :test_framework end end end
Version data entries
69 entries across 64 versions & 3 rubygems