Class: BlueberryCMS::Image

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document
Defined in:
app/models/blueberry_cms/image.rb

Class Method Summary collapse

Class Method Details

.find(id) ⇒ Object



10
11
12
13
14
15
# File 'app/models/blueberry_cms/image.rb', line 10

def self.find(id)
  _id = BSON::ObjectId.from_string(id)
  page = BlueberryCMS::Page.find_by('blocks.images._id' => _id)
  gallery = page.blocks.find_by('images._id' => _id)
  gallery.images.find_by('_id' => _id)
end