Sha256: 1bed44365be3bdabdb5ba7abcaa01dfd152589f811013ff9b4d2884b8646e901
Contents?: true
Size: 703 Bytes
Versions: 24
Compression:
Stored size: 703 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 :versioning, type: :boolean, default: false, desc: "Enable mongoid versioning" 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
24 entries across 24 versions & 2 rubygems