Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Define issues with MedicationDetails and tests #874

Merged
merged 3 commits into from
Dec 15, 2016

Conversation

mkly
Copy link
Contributor

@mkly mkly commented Dec 15, 2016

Fixes Issue with promise not being detected and defines issues with return values

Changes proposed in this pull request:

  • Add mixin unit test for MedicationDetails
  • Define issue where getMedicationPrice and getMedicationName do
    not return a value on first retrieval
  • Add documentation explaining issue with return values
  • Fix error on getMedicationPrice if attribute is not a promise
  • Remove duplicate calls to get when a promise is detected

Not changing methods to use Ember.RSVP.Promise as anything that uses
those methods would currently not be setup to handle a returned
promise. This may want to be adjusted in the future.

cc @HospitalRun/core-maintainers

mkly added 3 commits December 14, 2016 21:01
- Add mixin unit test for `MedicationDetails`
- Define issue where `getMedicationPrice` and `getMedicationName` do
  not return a value on first retrieval
- Add documentation explaining issue with return values
- Fix error on `getMedicationPrice` if attribute is not a promise
- Remove duplicate calls to `get` when a promise is detected

Not changing methods to use `Ember.RSVP.Promise` as anything that uses
those methods would currently not be setup to handle a returned
promise. This may want to be adjusted in the future.
Copy link
Member

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for the PR @mkly!

BTW - getMedicationPrice and getMedicationName are only used via computed properties on the medication model and those CPs fire when the value changes. Those functions could probably be moved out of the mixin and into the model since they are only used there.

@jkleinsc jkleinsc merged commit 4705f54 into HospitalRun:master Dec 15, 2016
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