Skip to content

Instantly share code, notes, and snippets.

@gabrielgilini
Created September 11, 2014 20:54
Show Gist options
  • Save gabrielgilini/02d7a05d4a48dd90aa66 to your computer and use it in GitHub Desktop.
Save gabrielgilini/02d7a05d4a48dd90aa66 to your computer and use it in GitHub Desktop.
diff --cc app/concerns/flowable.rb
index 70cc56b,36d5f98..0000000
--- a/app/concerns/flowable.rb
+++ b/app/concerns/flowable.rb
@@@ -161,7 -161,7 +161,11 @@@ module Flowabl
all_patients = all_patients.where(id: patient_ids) if patient_ids.any?
patients_without_warnings = Patient.where("1 = 2") if send_via.empty?
++<<<<<<< HEAD
+ patients_without_warnings ||= Patient.where(provider_id: provider_id).where(conditions.to_a.join(" OR ")).where(filters.keys.join(" AND "), *filters.values)
++=======
+ patients_without_warnings ||= Patient.where(provider_id: provider_id).where((conditions.to_a + filters.keys).join(" AND "), *filters.values)
++>>>>>>> origin/program_creation_tools
puts [
all_patients.to_sql,
diff --cc spec/support/shared_examples/flowable_shared_examples.rb
index 0359c03,040370a..0000000
--- a/spec/support/shared_examples/flowable_shared_examples.rb
+++ b/spec/support/shared_examples/flowable_shared_examples.rb
@@@ -474,15 -474,14 +474,26 @@@ shared_examples_for "a flowable message
let!(:patient_2) { create(:patient, provider: provider, email: nil) }
let!(:patient_3) { create(:patient, provider: provider) }
let!(:patient_4) { create(:patient, provider: provider) }
++<<<<<<< HEAD
+ let!(:patient_5) { create(:patient, provider: provider, phone: nil, email: nil) }
+ context "a single send via" do
+ it "should return any patient without the specified language" do
+ klazz.patients_with_warnings(provider.id, ["sms"], ["English"], []).should =~ [patient_1, patient_5]
+ end
+ end
+ context "multiple send vias" do
+ it "should return any patient without the specified language" do
+ klazz.patients_with_warnings(provider.id, ["email", "sms", "voice"], ["English"], []).should =~ [patient_1]
++=======
+ context "a single send via" do
+ it "should return any patient without the specified language" do
+ klazz.patients_with_warnings(provider.id, ["sms"], ["English"], []).should =~ [patient_1]
+ end
+ end
+ context "a single send via" do
+ it "should return any patient without the specified language" do
+ klazz.patients_with_warnings(provider.id, ["email", "sms", "voice"], ["English"], []).should =~ [patient_1, patient_2]
++>>>>>>> origin/program_creation_tools
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment