Include linking objects properties in the property names reported

This commit is contained in:
Thomas Goyne 2017-09-07 15:50:07 -07:00
parent 2a28a29341
commit ada3d116af
1 changed files with 6 additions and 3 deletions

View File

@ -139,12 +139,15 @@ bool RealmObjectClass<T>::set_property(ContextType ctx, ObjectType object, const
template<typename T> template<typename T>
std::vector<String<T>> RealmObjectClass<T>::get_property_names(ContextType ctx, ObjectType object) { std::vector<String<T>> RealmObjectClass<T>::get_property_names(ContextType ctx, ObjectType object) {
auto realm_object = get_internal<T, RealmObjectClass<T>>(object); auto realm_object = get_internal<T, RealmObjectClass<T>>(object);
auto &properties = realm_object->get_object_schema().persisted_properties; auto &object_schema = realm_object->get_object_schema();
std::vector<String> names; std::vector<String> names;
names.reserve(properties.size()); names.reserve(object_schema.persisted_properties.size() + object_schema.computed_properties.size());
for (auto &prop : properties) { for (auto &prop : object_schema.persisted_properties) {
names.push_back(prop.name);
}
for (auto &prop : object_schema.computed_properties) {
names.push_back(prop.name); names.push_back(prop.name);
} }