Skip to content

Commit

Permalink
add reason field to source suggestion updates
Browse files Browse the repository at this point in the history
  • Loading branch information
acoffman committed Jun 22, 2017
1 parent 910f46f commit f79e0d6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/sources_controller.rb
Expand Up @@ -75,7 +75,7 @@ def update
end

def update_source_suggestion
status = params.permit(:status)
status = params.permit(:status, :reason)
suggestion = SourceSuggestion.find_by(id: params[:id])
authorize suggestion
if suggestion.update_attributes(status)
Expand Down
3 changes: 2 additions & 1 deletion app/presenters/source_suggestion_browse_row_presenter.rb
Expand Up @@ -19,7 +19,8 @@ def as_json(opts = {})
disease: suggestion.disease_name,
initial_comment: suggestion.initial_comment,
status: suggestion.status,
created_at: suggestion.created_at
created_at: suggestion.created_at,
reason: suggestion.reason
}
end
end
@@ -0,0 +1,5 @@
class AddReasonFieldToSourceSuggestion < ActiveRecord::Migration
def change
add_column :source_suggestions, :reason, :text
end
end
5 changes: 4 additions & 1 deletion db/structure.sql
Expand Up @@ -1136,7 +1136,8 @@ CREATE TABLE source_suggestions (
initial_comment text,
status text,
created_at timestamp without time zone,
updated_at timestamp without time zone
updated_at timestamp without time zone,
reason text
);


Expand Down Expand Up @@ -3259,3 +3260,5 @@ INSERT INTO schema_migrations (version) VALUES ('20170531193921');

INSERT INTO schema_migrations (version) VALUES ('20170609200608');

INSERT INTO schema_migrations (version) VALUES ('20170622160223');

0 comments on commit f79e0d6

Please sign in to comment.