Class: Mumuki::Classroom::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/mumuki/classroom/models/document.rb

Class Method Summary collapse

Class Method Details

.inherited(subclass) ⇒ Object



7
8
9
10
11
# File 'lib/mumuki/classroom/models/document.rb', line 7

def self.inherited(subclass)
  super
  subclass.include Mongoid::Document
  subclass.store_in collection: subclass.name.demodulize.tableize
end

.whitelist_attributes(json) ⇒ Object



3
4
5
# File 'lib/mumuki/classroom/models/document.rb', line 3

def self.whitelist_attributes(json)
  json.with_indifferent_access.except(:created_at, :updated_at, :_id).slice(*attribute_names)
end