Class: DcForum

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps
Defined in:
app/models/dc_forum.rb

Overview

Schema information

Collection name: dc_forum : Forums

_id                  BSON::ObjectId       _id
created_at           Time                 created_at
updated_at           Time                 updated_at
name                 String               Forum name (short description)
link                 String               Forum link
description          String               Long description of what is forum about
order                Integer              Order
topics               Integer              No of topics
replies              Integer              replies
forum_groups         Array                forum_groups
active               Boolean              Is active
created_by           BSON::ObjectId       created_by
updated_by           BSON::ObjectId       updated_by
dc_policy_rules      Embedded:DcPolicyRule dc_policy_rules

Instance Method Summary collapse

Instance Method Details

#do_before_saveObject

Update link when left blank.



72
73
74
75
76
# File 'app/models/dc_forum.rb', line 72

def do_before_save
  if self.link.size < 5
    self.link = self.name.strip.downcase.gsub(' ','-')
  end
end