Module: Mongoid::Document
- Defined in:
- lib/zbox/ext/mongoid.rb
Instance Method Summary collapse
Instance Method Details
#remove_attach ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/zbox/ext/mongoid.rb', line 18 def remove_attach attach=self.attach unless attach.blank? id = BSON::ObjectId.from_string(attach['grid_id']) MongoGrid.grid.delete(id) end end |
#remove_avatar ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/zbox/ext/mongoid.rb', line 11 def remove_avatar attach=self.avatar unless attach.blank? id = BSON::ObjectId.from_string(attach['grid_id']) MongoGrid.grid.delete(id) end end |
#remove_logo ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/zbox/ext/mongoid.rb', line 3 def remove_logo logo=self.logo unless logo.blank? id = BSON::ObjectId.from_string(logo['grid_id']) MongoGrid.grid.delete(id) end end |