Sha256: 82ba521db5044d9ad64d7ff3828a2c6a9166693c9fab5fa7f34a44a0fb93b45a
Contents?: true
Size: 667 Bytes
Versions: 3
Compression:
Stored size: 667 Bytes
Contents
require "rails/generators" require "generators/statesman/generator_helpers" module Statesman class MongoidTransitionGenerator < Rails::Generators::Base include Statesman::GeneratorHelpers desc "Create a Mongoid-based transition model with the required attributes" argument :parent, type: :string, desc: "Your parent model name" argument :klass, type: :string, desc: "Your transition model name" source_root File.expand_path("../templates", __FILE__) def create_model_file template("mongoid_transition_model.rb.erb", model_file_name) end private def collection_name klass.underscore.pluralize end end end
Version data entries
3 entries across 3 versions & 1 rubygems