module Mongoid::Clients::Options
Public Instance Methods
collection(parent = nil)
Also aliased as: collection_without_separated
Alias for: collection_with_separated
collection_name()
Also aliased as: collection_name_without_separated
Alias for: collection_name_with_separated
collection_name_with_separated()
click to toggle source
# File lib/mongoid/collection_separated/monkey_patches.rb, line 142 def collection_name_with_separated klass = self.class origin_collection_name = collection_name_without_separated return origin_collection_name unless self.class.respond_to?(:separated_field) separated_collection_name klass end
Also aliased as: collection_name
collection_with_separated(parent = nil)
click to toggle source
# File lib/mongoid/collection_separated/monkey_patches.rb, line 131 def collection_with_separated(parent = nil) klass = self.class origin_collection = collection_without_separated(parent) return origin_collection unless self.class.respond_to?(:separated_field) origin_collection.instance_variable_set :@name, separated_collection_name(klass) origin_collection end
Also aliased as: collection
separated_collection_name(klass)
click to toggle source
# File lib/mongoid/collection_separated/monkey_patches.rb, line 152 def separated_collection_name(klass) klass.where(klass.separated_field => self.send(klass.separated_field)).ensured_collection.name end