Skip to content

Commit

Permalink
show exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
kjgarza committed Oct 17, 2018
1 parent 20872e8 commit 14e4a3a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Report < ApplicationRecord
validates :validate_sushi, sushi: {presence: true}
attr_readonly :created_by, :month, :year, :client_id

serialize :exceptions, Array
# serialize :exceptions, Array
before_create :set_id
before_validation :set_uid, on: :create
after_save :push_report
Expand Down
3 changes: 2 additions & 1 deletion app/serializers/report_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def report_header
:created => object.created,
:reporting_period => object.reporting_period,
:report_filters=> object.report_filters,
:report_attributes => object.report_attributes
:report_attributes => object.report_attributes,
:exceptions => object.exceptions,
}
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class ChangeExceptionsToBeJsonInReports < ActiveRecord::Migration[5.1]
def change
change_column :reports, :exceptions, :json
end
end
4 changes: 2 additions & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20180522095206) do
ActiveRecord::Schema.define(version: 20181017150207) do

create_table "error_models", id: false, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t|
t.integer "code"
Expand Down Expand Up @@ -50,7 +50,7 @@
t.json "report_filters"
t.json "report_attributes"
t.json "report_datasets"
t.string "exceptions"
t.json "exceptions"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "year"
Expand Down

0 comments on commit 14e4a3a

Please sign in to comment.