Module: Mongoid::Document

Defined in:
lib/zbox/ext/mongoid.rb

Instance Method Summary collapse

Instance Method Details

#remove_attachObject



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_avatarObject



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_logoObject



3
4
5
6
7
8
9
# File 'lib/zbox/ext/mongoid.rb', line 3

def 
  =self.
  unless .blank?
    id = BSON::ObjectId.from_string(['grid_id'])
    MongoGrid.grid.delete(id)
  end
end