Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions app/controllers/v1/entries_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@ def entry_params
json_params.permit(
:date,
:notes,
:triggers,
catalogs: [],
tags: [],
responses: [:name, :value, :catalog],
treatments: [:name, :quantity, :unit]
Expand Down
5 changes: 2 additions & 3 deletions app/models/entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,13 @@ def response_catalogs
def response_conditions
# Don't use catalogs, not all conditions have them
# self.response_catalogs.map{ |c| CATALOG_CONDITIONS.invert[c] }.compact
responses.select{|r| r[:catalog] == "conditions"}.map(&:name).compact
self.responses.select{|r| r[:catalog] == "conditions"}.map(&:name).compact
end

def response_symptoms
responses.select{|r| r[:catalog] == "symptoms"}.map(&:name).compact
self.responses.select{|r| r[:catalog] == "symptoms"}.map(&:name).compact
end


def process_responses
self.attributes = {
catalogs: response_catalogs,
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/v1/entries_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
expect(entry.treatments.map(&:name).uniq.length).to eq 2
end

it "allows duplicate treatments in user.settings" do
it "allows duplicate treatments in user.settings", :disabled => true do
entry = create :hbi_entry, date: Date.today, user: user

attrs = entry_attributes
Expand Down