Skip to content

Commit

Permalink
feat: fix json issues
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticspoon committed Sep 8, 2024
1 parent dd07321 commit 17d0614
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/datatables/application_datatable.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class ApplicationDatatable
prepend ActiveSupport::ToJsonWithActiveSupportEncoder

attr_reader :base_relation, :params

DEFAULT_PER_PAGE = 10
Expand Down
1 change: 1 addition & 0 deletions app/models/all_casa_admin.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class AllCasaAdmin < ApplicationRecord
prepend ActiveSupport::ToJsonWithActiveSupportEncoder
include Roles

# Include default devise modules. Others available are:
Expand Down
1 change: 1 addition & 0 deletions app/models/casa_case.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class CasaCase < ApplicationRecord
prepend ActiveSupport::ToJsonWithActiveSupportEncoder
include ByOrganizationScope
include DateHelper
include CasaCase::Validations
Expand Down
1 change: 1 addition & 0 deletions app/models/casa_org.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class CasaOrg < ApplicationRecord
prepend ActiveSupport::ToJsonWithActiveSupportEncoder
# NOTE: location of the default report template
CASA_DEFAULT_COURT_REPORT = File.new(Rails.root.join("app", "documents", "templates", "default_report_template.docx"), "r")
CASA_DEFAULT_LOGO = Rails.root.join("public", "logo.jpeg")
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/volunteers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
let(:data) { {recordsTotal: 51, recordsFiltered: 10, data: 10.times.map { {} }} }

before do
allow(VolunteerDatatable).to receive(:new).and_return double "datatable", as_json: data
allow(VolunteerDatatable).to receive(:new).and_return double "datatable", to_json: data.to_json
end

it "is successful" do
Expand Down

0 comments on commit 17d0614

Please sign in to comment.