-
Notifications
You must be signed in to change notification settings - Fork 35
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
Conversation
@@ -0,0 +1,61 @@ | |||
class ProtocolsController < ApplicationController |
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.
These should live in an Admin::
namespace
@@ -0,0 +1,66 @@ | |||
class ProtocolDrugsController < ApplicationController |
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.
These should live in an Admin::
namespace
validates :dosage, presence: true | ||
|
||
def assign_id | ||
self.id = SecureRandom.uuid |
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.
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.
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.
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.
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.
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 } |
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.
I don't think we need JSON replies in the admin UI
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.
Yeah, we'll remove these.
- Change paths everywhere - Fix tests - Remove json from controllers
Issue: simpledotorg/simple-android#9