Module: Likeable::MongoidAdapter

Defined in:
lib/likeable/adapters/mongoid_adapter.rb

Class Method Summary collapse

Class Method Details

.cast_idObject



3
4
5
# File 'lib/likeable/adapters/mongoid_adapter.rb', line 3

def self.cast_id
  lambda { |id| id.to_s }
end

.find_manyObject



13
14
15
16
17
# File 'lib/likeable/adapters/mongoid_adapter.rb', line 13

def self.find_many
  lambda { |klass, ids|
    klass.find ids
  }
end

.find_oneObject



7
8
9
10
11
# File 'lib/likeable/adapters/mongoid_adapter.rb', line 7

def self.find_one
  lambda { |klass, id|
    klass.find id
  }
end