Skip to content
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

Add Protocols, and Protocol Drugs #25

Merged
merged 11 commits into from
Jun 5, 2018
Merged

Add Protocols, and Protocol Drugs #25

merged 11 commits into from
Jun 5, 2018

Conversation

ssrihari
Copy link
Contributor

@ssrihari ssrihari commented Jun 4, 2018

@ssrihari ssrihari added this to Doing in RedApp Jun 4, 2018
@@ -0,0 +1,61 @@
class ProtocolsController < ApplicationController
Copy link
Contributor

Choose a reason for hiding this comment

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

These should live in an Admin:: namespace

@@ -0,0 +1,66 @@
class ProtocolDrugsController < ApplicationController
Copy link
Contributor

Choose a reason for hiding this comment

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

These should live in an Admin:: namespace

validates :dosage, presence: true

def assign_id
self.id = SecureRandom.uuid
Copy link
Contributor

Choose a reason for hiding this comment

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

We should discuss this. I think we should switch all of these records to create UUIDs as ID by default, or move UUID to a separate field and use bigint IDs. As it is, this is messy; I ran into the same issue with Facility.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Creating UUIDs by default in the database sounds like the way to go. We'll do this for all entities that are created via the admin interface.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We'll do this after the facilities PR is merged in, so that we don't conflict with your changes of adding pgcrypto or another extension.

respond_to do |format|
if @protocol.save
format.html { redirect_to @protocol, notice: 'Protocol was successfully created.' }
format.json { render :show, status: :created, location: @protocol }
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need JSON replies in the admin UI

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, we'll remove these.

- Change paths everywhere
- Fix tests
- Remove json from controllers
@ssrihari ssrihari merged commit 10b1ff9 into master Jun 5, 2018
@ssrihari ssrihari changed the title Protocols Add Protocols, and Protocol Drugs Jun 5, 2018
@ssrihari ssrihari moved this from Doing to Done in RedApp Jun 5, 2018
@ssrihari ssrihari deleted the protocols branch June 11, 2018 08:51
@timcheadle timcheadle removed this from Dev+QA Complete in RedApp Jul 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants