started refactoring collection proxy
This commit is contained in:
@@ -172,7 +172,7 @@ void relation_completer<Type, Observers...>::on_has_many(const char *id, Collect
|
||||
using relation_value_type = many_to_many_relation<Type, value_type>;
|
||||
|
||||
// Check if the object_ptr type is already inserted in the schema (by id)
|
||||
auto foreign_node = find_node(typeid(value_type));
|
||||
const auto foreign_node = find_node(typeid(value_type));
|
||||
if (!foreign_node) {
|
||||
// Todo: throw internal error or attach node
|
||||
return;
|
||||
@@ -191,7 +191,7 @@ void relation_completer<Type, Observers...>::on_has_many(const char *id, Collect
|
||||
const auto local_endpoint = std::make_shared<relation_endpoint>(id, relation_type::HasMany, *foreign_node);
|
||||
nodes_.top()->info_->register_relation_endpoint(typeid(value_type), local_endpoint);
|
||||
} else {
|
||||
// A relation table is necessary
|
||||
// A relation table is necessary.
|
||||
// Endpoint was not found.
|
||||
// Always attach a many-to-many relation type. If later a
|
||||
// belongs-to relation handles this relation, the many-to-many
|
||||
@@ -222,8 +222,7 @@ template<typename Type, template<typename> typename... Observers>
|
||||
template<class CollectionType>
|
||||
void relation_completer<Type, Observers...>::on_has_many(const char *id, CollectionType &, const char *join_column,
|
||||
const utils::foreign_attributes &,
|
||||
std::enable_if_t<!is_object_ptr<typename CollectionType::value_type>::value>
|
||||
* /*unused*/) {
|
||||
std::enable_if_t<!is_object_ptr<typename CollectionType::value_type>::value>* /*unused*/) {
|
||||
using value_type = typename CollectionType::value_type;
|
||||
using relation_value_type = many_to_relation<Type, value_type>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user