Upgrade to Pro — share decks privately, control downloads, hide ads and more …

I Know I Can, But Should I? Evaluating Alternat...

I Know I Can, But Should I? Evaluating Alternatives

You can use a hammer to drive a screw into wood, but I’d recommend a screwdriver. Why? And when is a hammer the better option? This talk will propose a framework to use when comparing alternative technical choices. I won’t decide for you, but will leave you with a structure to apply in your decision-making process.

The ruby toolbox is vast. While Rails provides a default experience, it leaves plenty of room for alternatives. In learning how to do something, you may uncover different ways to accomplish the same goal. Determine which tool fits best in your situation with these lessons.

Kevin Murphy

April 09, 2019
Tweet

More Decks by Kevin Murphy

Other Decks in Technology

Transcript

  1. @kevin_j_m Price Ease of Use Compliance Delivery Time 30% 10%

    20% 40% Weighted Scoring Model Criteria Weight
  2. @kevin_j_m Price Ease of Use Compliance Delivery Time 30% 10%

    20% 40% A Weighted Scoring Model Criteria Weight
  3. @kevin_j_m Price Ease of Use Compliance Delivery Time 30% 10%

    20% 40% A B Weighted Scoring Model Criteria Weight
  4. @kevin_j_m Price Ease of Use Compliance Delivery Time 30% 10%

    20% 40% A B 8 2 5 3 Weighted Scoring Model Criteria Weight
  5. @kevin_j_m Price Ease of Use Compliance Delivery Time 30% 10%

    20% 40% A B 8 2 5 3 3 5 7 4 Weighted Scoring Model Criteria Weight
  6. @kevin_j_m Price Ease of Use Compliance Delivery Time 30% 10%

    20% 40% A B 8 2 5 3 3 5 7 4 4.8 Weighted Scoring Model Criteria Weight
  7. @kevin_j_m Price Ease of Use Compliance Delivery Time 30% 10%

    20% 40% A B 8 2 5 3 3 5 7 4 4.8 4.4 Weighted Scoring Model Criteria Weight
  8. @kevin_j_m Price Ease of Use Compliance Delivery Time 30% 10%

    20% 40% A B 8 2 5 3 3 5 7 4 4.8 4.4 Weighted Scoring Model Criteria Weight
  9. @kevin_j_m Send Welcome Email Send a welcome email to a

    study participant after they have enrolled.
  10. @kevin_j_m scenario “Enrolling a participant” do visit new_study_participant_path(study) fill_in "First

    name", with: "Kevin" fill_in "Email", with: "[email protected]" expect { click_button "Enroll" } .to have_enqueued_job .on_queue(“mailers”) end
  11. @kevin_j_m class StudyParticipant < ApplicationRecord after_commit :deliver_welcome_mailer, on: :create private

    def deliver_welcome_mailer StudyParticipantMailer.with(study_participant: self) .welcome_email .deliver_later end end + + + + + +
  12. @kevin_j_m class StudyEnrollment def initialize(participant_params) @participant_params = participant_params end def

    save @study_participant = StudyParticipant.new(@participant_params) end end
  13. @kevin_j_m class StudyEnrollment def initialize(participant_params) @participant_params = participant_params end def

    save @study_participant = StudyParticipant.new(@participant_params) if @study_participant.save send_welcome_email end end end
  14. @kevin_j_m class StudyParticipantsController < ApplicationController def create @study_participant = StudyParticipant.new(

    study_participant_params) if @study_participant.save redirect_to study_study_participants_path else render :new end end end
  15. @kevin_j_m class StudyParticipantsController < ApplicationController def create enrollment = StudyEnrollment.new(

    study_participant_params) if @study_participant.save redirect_to study_study_participants_path else render :new end end end +
  16. @kevin_j_m class StudyParticipantsController < ApplicationController def create enrollment = StudyEnrollment.new(

    study_participant_params) if enrollment.save redirect_to study_study_participants_path else render :new end end end + +
  17. @kevin_j_m class StudyParticipantsController < ApplicationController def create enrollment = StudyEnrollment.new(

    study_participant_params) if enrollment.save redirect_to study_study_participants_path else @study_participant = enrollment.study_participant render :new end end end + + +
  18. @kevin_j_m scenario “Co-investigators cannot create a study protocol” do sign_in

    co_investigator_user visit new_study_protocol_path(study) end
  19. @kevin_j_m scenario “Co-investigators cannot create a study protocol” do sign_in

    co_investigator_user visit new_study_protocol_path(study) within(".alert-danger") do expect(page).to have_content "Only Principal Investigators may create study protocols" end end
  20. @kevin_j_m scenario “Co-investigators cannot create a study protocol” do sign_in

    co_investigator_user visit new_study_protocol_path(study) within(".alert-danger") do expect(page).to have_content "Only Principal Investigators may create study protocols" end expect(page).to have_current_path root_path end
  21. @kevin_j_m class StudyProtocolsController < ApplicationController rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized def

    new @study_protocol = StudyProtocol.new(study: study) authorize(@study_protocol) end end + + +
  22. @kevin_j_m scenario “Viewing a data collection event” do collected_at =

    Time.zone.local(2019, 5, 1, 15, 30) collection_event = create :data_collection_event, created_at: collected_at end
  23. @kevin_j_m scenario “Viewing a data collection event” do collected_at =

    Time.zone.local(2019, 5, 1, 15, 30) collection_event = create :data_collection_event, created_at: collected_at visit data_collection_event_path(collection_event) end
  24. @kevin_j_m scenario “Viewing a data collection event” do collected_at =

    Time.zone.local(2019, 5, 1, 15, 30) collection_event = create :data_collection_event, created_at: collected_at visit data_collection_event_path(collection_event) within ".summary-information .collected-date" do expect(page).to have_content "May 1, 2019" end end
  25. @kevin_j_m scenario “Viewing a data collection event” do collected_at =

    Time.zone.local(2019, 5, 1, 15, 30) collection_event = create :data_collection_event, created_at: collected_at visit data_collection_event_path(collection_event) within ".summary-information .collected-date" do expect(page).to have_content "May 1, 2019" end end
  26. @kevin_j_m scenario “Viewing a data collection event” do collected_at =

    Time.zone.local(2019, 5, 1, 15, 30) collection_event = create :data_collection_event, created_at: collected_at visit data_collection_event_path(collection_event) within ".summary-information .collected-date" do expect(page).to have_content "May 1, 2019" end end
  27. @kevin_j_m scenario “Viewing a data collection event” do collected_at =

    Time.zone.local(2019, 5, 1, 15, 30) collection_event = create :data_collection_event, created_at: collected_at visit data_collection_event_path(collection_event) within ".summary-information .collected-date" do expect(page).to have_content "May 1, 2019" end end
  28. @kevin_j_m scenario “Viewing a data collection event” do collected_at =

    Time.zone.local(2019, 5, 1, 15, 30) collection_event = create :data_collection_event, collected_at: collected_at visit data_collection_event_path(collection_event) within ".summary-information .collected-date" do expect(page).to have_content "May 1, 2019" end end
  29. @kevin_j_m Personal Info Warning Warn a user that editing their

    personal information may make them ineligible for the study.
  30. @kevin_j_m scenario “Warn about personal information changes” do visit edit_personal_information_path(participant)

    within(".alert-warning") do expect(page).to have_content “Modifying your information may risk your eligibility.” end end
  31. @kevin_j_m scenario “Warn about personal information changes” do visit edit_personal_information_path(participant)

    within(".alert-warning") do expect(page).to have_content “Modifying your information may risk your eligibility.” end end - - - - - - - -
  32. @kevin_j_m Personal Info Warning Per FDA RC2019-PII, warn a user

    that editing their personal information may make them ineligible for the study.
  33. @kevin_j_m RC2019-PII …Failure to notify participants of this may be

    punishable by up to 30 days in jail or fines of $1,000,000 per documented occurrence.
  34. @kevin_j_m scenario “Editing Personal Information” do visit edit_personal_information_path(participant) within(".alert-warning") do

    expect(page).to have_content "Modifying your information your may risk your eligibility.” end fill_in “First Name”, with: “Kevin” … end + + + +