register_modules/app/models/registered_module.rb

28 lines
690 B
Ruby

class RegisteredModule
include Mongoid::Document
include Mongoid::Timestamps
include OrbitCategory::Categorizable
include OrbitTag::Taggable
include Slug
field :module_key
field :git_path
field :name, as: :slug_title, localize: true
field :create_user_id, type: BSON::ObjectId
field :update_user_id, type: BSON::ObjectId
field :approved, type: Boolean, :default => false
field :completed, type: Boolean, :default => false
field :module_type, type: BSON::ObjectId
field :step_number, type: Integer
mount_uploader :template, TemplateUploader
def reject
self.completed = false
self.step_number = 3
self.approved = false
self.save
end
end