Class: SubTopic

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

Instance Method Summary collapse

Instance Method Details

#creatorObject



15
16
17
18
# File 'app/models/sub_topic.rb', line 15

def creator
  return nil if self.creator_id.blank?
  User.find self.creator_id
end

#creator=(u) ⇒ Object



20
21
22
23
# File 'app/models/sub_topic.rb', line 20

def creator= u
  return unless u.is_a?(User)
  self.creator_id = u.id
end