Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

RIO-115: Handle Reading Reference fields #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

RIO-115: Handle Reading Reference fields #65

wants to merge 1 commit into from

Conversation

ashihaby
Copy link
Contributor

@ashihaby ashihaby commented May 2, 2015

No description provided.

@@ -238,6 +237,9 @@ class ReadHandler(globals: ReallyGlobals) extends Actor with Stash with ActorLog
private def getRequestFields(cmdFields: Set[FieldKey], model: Model): Set[FieldKey] =
if (cmdFields.isEmpty) model.fields.keySet else cmdFields

private def availableFields(doc: JsObject, requestedFields: Set[FieldKey], model: Model) =
requestedFields.filter(f => model.fields(f).isInstanceOf[CalculatedField[_]] || (doc \ f).asOpt[JsValue].isDefined)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already wrote a helper to fetch all the reactive fields model.reactiveFields, not that it caches this loop so it's much better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This helper to remove fields that doesn't exist in the returned object.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified to use model.reactiveFields

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants