Class: Mumuki::Classroom::Suggestion

Inherits:
Document
  • Object
show all
Includes:
Mongoid::Timestamps
Defined in:
lib/mumuki/classroom/models/suggestion.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Document

inherited, whitelist_attributes

Class Method Details

.create_from(message, assignment) ⇒ Object



26
27
28
# File 'lib/mumuki/classroom/models/suggestion.rb', line 26

def self.create_from(message, assignment)
  create message.merge(guide_slug: assignment.guide['slug'], exercise: assignment.exercise)
end

Instance Method Details

#add_submission!(submission) ⇒ Object



18
19
20
# File 'lib/mumuki/classroom/models/suggestion.rb', line 18

def add_submission!(submission)
  update_attributes! submissions: submissions + [submission]
end

#content_htmlObject



22
23
24
# File 'lib/mumuki/classroom/models/suggestion.rb', line 22

def content_html
  Mumukit::ContentType::Markdown.to_html content
end