Sha256: 142f853548de70db70c96df4f9b27152802bedd8d46595f1d6b6e55c566aec65
Contents?: true
Size: 780 Bytes
Versions: 36
Compression:
Stored size: 780 Bytes
Contents
require 'rails/generators/base' module MongoModel module Generators class ModelGenerator < Rails::Generators::NamedBase source_root File.expand_path('../templates', __FILE__) argument :attributes, :type => :array, :default => [], :banner => "field:type field:type" class_option :timestamps, :type => :boolean, :aliases => "-T", :default => true, :desc => "Add timestamp fields (created_at, updated_at)" class_option :embedded, :type => :boolean, :aliases => "-E", :default => false, :desc => "Inherit from EmbeddedDocument" check_class_collision 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
36 entries across 36 versions & 1 rubygems