module Mongo::Voteable::Integrations::Mongoid::ClassMethods

Public Instance Methods

voteable_collection() click to toggle source
# File lib/voteable_mongo/integrations/mongoid.rb, line 20
def voteable_collection
  collection
end
voteable_foreign_key(metadata) click to toggle source
# File lib/voteable_mongo/integrations/mongoid.rb, line 24
def voteable_foreign_key(metadata)
  metadata.foreign_key.to_s
end
voteable_relation(class_name) click to toggle source
# File lib/voteable_mongo/integrations/mongoid.rb, line 16
def voteable_relation(class_name)
  relations.find{ |x, r| r.class_name == class_name }.try(:last)
end