register_modules/app/models/registered_module.rb

28 lines
690 B
Ruby
Raw Normal View History

2014-12-30 11:52:45 +00:00
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