-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autodeletion #2923
base: main
Are you sure you want to change the base?
Autodeletion #2923
Conversation
def self.included(base) | ||
base.extend(ClassMethods) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this is to gnarly i can make a change ;)
c.save! | ||
end | ||
|
||
it 'deletes pt_a on the right day' do | ||
Timecop.freeze(1.day.ago) do | ||
Patient.autodelete! | ||
assert_includes Patient.all, @pt_a | ||
end | ||
|
||
# present day - doesn't delete because <, not <= | ||
Patient.autodelete! | ||
assert_includes Patient.all, @pt_a | ||
|
||
Timecop.freeze(1.day.after) do | ||
Patient.autodelete! | ||
refute_includes Patient.all, @pt_a | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok this is a lil weird, because i'm using <
with today
, so it does a date-, not time-based comparison. I don't particularly have an issue with this -- I don't think funds will care exactly which day a patient deletes. but let me know and I can make it a bit more intuitive.
While this draft works, given our discussions yesterday, I think we should take a bit of time to consider exactly what we want this PR to do (and not do) |
@lomky let me know what you think of this — and particularly what other kinds of tests would help! have some time to work on things this week |
I rule and have completed some work on Case Manager that's ready for review!
(brief, plain english overview of your changes here)
This pull request makes the following changes:
Timecop
for testing(If there are changes to the views, please include a screenshot so we know what to look for!)
It relates to the following issue #s:
For reviewer:
feature
if it contains a feature, fix, or similar. This is anything that contains a user-facing fix in some way, such as frontend changes, alterations to backend behavior, or bug fixes.dependencies
if it contains library upgrades or similar. This is anything that upgrades any dependency, such as a Gemfile update or npm package upgrade.