def initialize(options)
if (missing_options = OPTIONS - [ :min, :max ] - options.keys ).any?
raise ArgumentError, "The options #{missing_options * ', '} are required", caller
end
@repository_name = options.fetch(:repository_name)
@near_relationship_name = options.fetch(:near_relationship_name)
@remote_relationship_name = options.fetch(:remote_relationship_name)
@child_model = options.fetch(:child_model)
@parent_model = options.fetch(:parent_model)
@parent_properties = options.fetch(:parent_key)
@child_properties = options.fetch(:child_key)
@mutable = options.delete(:mutable) || false
@name = near_relationship.name
@query = options.reject{ |key,val| OPTIONS.include?(key) }
@extra_links = []
@options = options
end