From 0b7f51d307bf443108376165ac41244cca771292 Mon Sep 17 00:00:00 2001 From: Ian Bulmer Date: Fri, 28 Jul 2023 12:06:41 -0400 Subject: [PATCH 1/8] add papertrail to all things --- Gemfile.lock | 1 + app/models/account_request.rb | 3 ++- app/models/adjustment.rb | 3 ++- app/models/annual_report.rb | 3 ++- app/models/audit.rb | 3 ++- app/models/barcode_item.rb | 3 ++- app/models/base_item.rb | 3 ++- app/models/broadcast_announcement.rb | 3 ++- app/models/county.rb | 3 ++- app/models/distribution.rb | 3 ++- app/models/donation.rb | 3 ++- app/models/donation_site.rb | 3 ++- app/models/inventory_item.rb | 5 +++-- app/models/item.rb | 3 ++- app/models/item_category.rb | 3 ++- app/models/kit.rb | 3 ++- app/models/kit_allocation.rb | 3 ++- app/models/line_item.rb | 3 ++- app/models/manufacturer.rb | 3 ++- app/models/ndbn_member.rb | 3 ++- app/models/organization.rb | 3 ++- app/models/partner.rb | 3 ++- app/models/partner_group.rb | 3 ++- app/models/partners/base.rb | 3 ++- app/models/partners/served_area.rb | 3 ++- app/models/product_drive.rb | 3 ++- app/models/product_drive_participant.rb | 3 ++- app/models/purchase.rb | 3 ++- app/models/question.rb | 3 ++- app/models/request.rb | 3 ++- app/models/role.rb | 3 ++- app/models/storage_location.rb | 3 ++- app/models/transfer.rb | 3 ++- app/models/user.rb | 3 ++- app/models/users_role.rb | 3 ++- app/models/vendor.rb | 3 ++- 36 files changed, 72 insertions(+), 36 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9f95d142b3..f5101cde8d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -620,6 +620,7 @@ GEM zeitwerk (2.6.9) PLATFORMS + arm64-darwin-20 arm64-darwin-21 arm64-darwin-22 x86_64-darwin-20 diff --git a/app/models/account_request.rb b/app/models/account_request.rb index 39fb9b686b..c4a2f619d3 100644 --- a/app/models/account_request.rb +++ b/app/models/account_request.rb @@ -15,7 +15,8 @@ # updated_at :datetime not null # ndbn_member_id :bigint # -class AccountRequest < ApplicationRecord +class AccountRequest < ApplicationRecord + has_paper_trail validates :name, presence: true validates :email, presence: true, uniqueness: true validates :request_details, presence: true, length: { minimum: 50 } diff --git a/app/models/adjustment.rb b/app/models/adjustment.rb index e03c730b89..dfff1ffbc2 100644 --- a/app/models/adjustment.rb +++ b/app/models/adjustment.rb @@ -11,7 +11,8 @@ # user_id :bigint # -class Adjustment < ApplicationRecord +class Adjustment < ApplicationRecord + has_paper_trail belongs_to :organization belongs_to :storage_location belongs_to :user diff --git a/app/models/annual_report.rb b/app/models/annual_report.rb index 406fa7c7f7..74ea7a98eb 100644 --- a/app/models/annual_report.rb +++ b/app/models/annual_report.rb @@ -9,7 +9,8 @@ # updated_at :datetime not null # organization_id :bigint # -class AnnualReport < ApplicationRecord +class AnnualReport < ApplicationRecord + has_paper_trail belongs_to :organization, inverse_of: :annual_reports validates :year, numericality: { greater_than: 1900, less_than: 10_000 } diff --git a/app/models/audit.rb b/app/models/audit.rb index e314d25621..5dec7f6d19 100644 --- a/app/models/audit.rb +++ b/app/models/audit.rb @@ -12,7 +12,8 @@ # user_id :bigint # -class Audit < ApplicationRecord +class Audit < ApplicationRecord + has_paper_trail belongs_to :user belongs_to :organization belongs_to :storage_location diff --git a/app/models/barcode_item.rb b/app/models/barcode_item.rb index a66142be92..ac186bf7e4 100644 --- a/app/models/barcode_item.rb +++ b/app/models/barcode_item.rb @@ -12,7 +12,8 @@ # organization_id :integer # -class BarcodeItem < ApplicationRecord +class BarcodeItem < ApplicationRecord + has_paper_trail belongs_to :organization, optional: true belongs_to :barcodeable, polymorphic: true, dependent: :destroy, counter_cache: :barcode_count diff --git a/app/models/base_item.rb b/app/models/base_item.rb index c3a72e2352..c9455dbc9a 100644 --- a/app/models/base_item.rb +++ b/app/models/base_item.rb @@ -13,7 +13,8 @@ # updated_at :datetime not null # -class BaseItem < ApplicationRecord +class BaseItem < ApplicationRecord + has_paper_trail has_many :items, dependent: :destroy, inverse_of: :base_item, foreign_key: :partner_key, primary_key: :partner_key has_many :barcode_items, as: :barcodeable, dependent: :destroy diff --git a/app/models/broadcast_announcement.rb b/app/models/broadcast_announcement.rb index 86d06bd08f..6352692553 100644 --- a/app/models/broadcast_announcement.rb +++ b/app/models/broadcast_announcement.rb @@ -11,7 +11,8 @@ # organization_id :bigint # user_id :bigint not null # -class BroadcastAnnouncement < ApplicationRecord +class BroadcastAnnouncement < ApplicationRecord + has_paper_trail belongs_to :user belongs_to :organization, optional: true validates :link, format: URI::DEFAULT_PARSER.make_regexp(%w[http https]), allow_blank: true diff --git a/app/models/county.rb b/app/models/county.rb index 0246d5cad4..4bb4153080 100644 --- a/app/models/county.rb +++ b/app/models/county.rb @@ -9,7 +9,8 @@ # created_at :datetime not null # updated_at :datetime not null # -class County < ApplicationRecord +class County < ApplicationRecord + has_paper_trail has_many :served_areas, class_name: "Partners::ServedArea", dependent: :destroy SORT_ORDER = %w[US_County Other] diff --git a/app/models/distribution.rb b/app/models/distribution.rb index 04ade8c54c..2706987f19 100644 --- a/app/models/distribution.rb +++ b/app/models/distribution.rb @@ -18,7 +18,8 @@ # storage_location_id :integer # -class Distribution < ApplicationRecord +class Distribution < ApplicationRecord + has_paper_trail # Distributions are issued from a single storage location, so we associate # them so that on-hand amounts can be verified belongs_to :storage_location diff --git a/app/models/donation.rb b/app/models/donation.rb index c0043bfdf3..12155e12e8 100644 --- a/app/models/donation.rb +++ b/app/models/donation.rb @@ -17,7 +17,8 @@ # storage_location_id :integer # -class Donation < ApplicationRecord +class Donation < ApplicationRecord + has_paper_trail SOURCES = { product_drive: "Product Drive", manufacturer: "Manufacturer", donation_site: "Donation Site", diff --git a/app/models/donation_site.rb b/app/models/donation_site.rb index 7e52a3de2c..80ee3e2e64 100644 --- a/app/models/donation_site.rb +++ b/app/models/donation_site.rb @@ -12,7 +12,8 @@ # organization_id :integer # -class DonationSite < ApplicationRecord +class DonationSite < ApplicationRecord + has_paper_trail require "csv" belongs_to :organization diff --git a/app/models/inventory_item.rb b/app/models/inventory_item.rb index d915ae8ee3..582621f0b7 100644 --- a/app/models/inventory_item.rb +++ b/app/models/inventory_item.rb @@ -10,10 +10,11 @@ # storage_location_id :integer # -class InventoryItem < ApplicationRecord +class InventoryItem < ApplicationRecord + has_paper_trail MAX_INT = 2**31 - has_paper_trail + has_paper_trail EARLIEST_VERSION = "2021-08-02" diff --git a/app/models/item.rb b/app/models/item.rb index 4f9f1073d7..ad323f75cf 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -21,7 +21,8 @@ # organization_id :integer # -class Item < ApplicationRecord +class Item < ApplicationRecord + has_paper_trail include Filterable include Exportable include Valuable diff --git a/app/models/item_category.rb b/app/models/item_category.rb index 9673d7dcc1..0b01ac1d16 100644 --- a/app/models/item_category.rb +++ b/app/models/item_category.rb @@ -9,7 +9,8 @@ # updated_at :datetime not null # organization_id :integer not null # -class ItemCategory < ApplicationRecord +class ItemCategory < ApplicationRecord + has_paper_trail validates :name, presence: true, uniqueness: { scope: :organization_id } validates :organization, presence: true validates :description, length: { maximum: 250 } diff --git a/app/models/kit.rb b/app/models/kit.rb index 041e1946fd..ed391426c0 100644 --- a/app/models/kit.rb +++ b/app/models/kit.rb @@ -11,7 +11,8 @@ # updated_at :datetime not null # organization_id :integer not null # -class Kit < ApplicationRecord +class Kit < ApplicationRecord + has_paper_trail include Itemizable include Filterable include Valuable diff --git a/app/models/kit_allocation.rb b/app/models/kit_allocation.rb index 814fd30709..7f2e86608f 100644 --- a/app/models/kit_allocation.rb +++ b/app/models/kit_allocation.rb @@ -10,7 +10,8 @@ # organization_id :bigint not null # storage_location_id :bigint not null # -class KitAllocation < ApplicationRecord +class KitAllocation < ApplicationRecord + has_paper_trail include Itemizable belongs_to :storage_location end diff --git a/app/models/line_item.rb b/app/models/line_item.rb index 6dd899e76a..76c3068031 100644 --- a/app/models/line_item.rb +++ b/app/models/line_item.rb @@ -11,7 +11,8 @@ # itemizable_id :integer # -class LineItem < ApplicationRecord +class LineItem < ApplicationRecord + has_paper_trail include ItemQuantity MAX_INT = 2**31 MIN_INT = -2**31 diff --git a/app/models/manufacturer.rb b/app/models/manufacturer.rb index f9ea0b7ea3..abaf9b101a 100644 --- a/app/models/manufacturer.rb +++ b/app/models/manufacturer.rb @@ -9,7 +9,8 @@ # organization_id :bigint # -class Manufacturer < ApplicationRecord +class Manufacturer < ApplicationRecord + has_paper_trail belongs_to :organization has_many :donations, inverse_of: :manufacturer, dependent: :destroy diff --git a/app/models/ndbn_member.rb b/app/models/ndbn_member.rb index 84db16f7e8..170adae01d 100644 --- a/app/models/ndbn_member.rb +++ b/app/models/ndbn_member.rb @@ -7,7 +7,8 @@ # updated_at :datetime not null # ndbn_member_id :bigint not null, primary key # -class NDBNMember < ApplicationRecord +class NDBNMember < ApplicationRecord + has_paper_trail self.primary_key = "ndbn_member_id" validates :ndbn_member_id, presence: true diff --git a/app/models/organization.rb b/app/models/organization.rb index 8e91cffa52..e58a3aa172 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -30,7 +30,8 @@ # ndbn_member_id :bigint # -class Organization < ApplicationRecord +class Organization < ApplicationRecord + has_paper_trail resourcify DIAPER_APP_LOGO = Rails.root.join("public", "img", "humanessentials_logo.png") diff --git a/app/models/partner.rb b/app/models/partner.rb index 18d6d02897..b83519505a 100644 --- a/app/models/partner.rb +++ b/app/models/partner.rb @@ -16,7 +16,8 @@ # partner_group_id :bigint # -class Partner < ApplicationRecord +class Partner < ApplicationRecord + has_paper_trail resourcify require "csv" diff --git a/app/models/partner_group.rb b/app/models/partner_group.rb index 1ebb6831ee..a9cf3e63ff 100644 --- a/app/models/partner_group.rb +++ b/app/models/partner_group.rb @@ -11,7 +11,8 @@ # updated_at :datetime not null # organization_id :bigint # -class PartnerGroup < ApplicationRecord +class PartnerGroup < ApplicationRecord + has_paper_trail include Deadlinable belongs_to :organization diff --git a/app/models/partners/base.rb b/app/models/partners/base.rb index 701b69f1aa..459b297a82 100644 --- a/app/models/partners/base.rb +++ b/app/models/partners/base.rb @@ -1,5 +1,6 @@ module Partners - class Base < ApplicationRecord + class Base < ApplicationRecord + has_paper_trail self.abstract_class = true end end diff --git a/app/models/partners/served_area.rb b/app/models/partners/served_area.rb index 2c9cc84d0d..41239f1bcc 100644 --- a/app/models/partners/served_area.rb +++ b/app/models/partners/served_area.rb @@ -10,7 +10,8 @@ # partner_profile_id :bigint not null # module Partners - class ServedArea < ApplicationRecord + class ServedArea < ApplicationRecord + has_paper_trail self.table_name = "partner_served_areas" belongs_to :partner_profile, class_name: "Partners::Profile" belongs_to :county diff --git a/app/models/product_drive.rb b/app/models/product_drive.rb index 929229b1da..8b43f34804 100644 --- a/app/models/product_drive.rb +++ b/app/models/product_drive.rb @@ -12,7 +12,8 @@ # organization_id :bigint # -class ProductDrive < ApplicationRecord +class ProductDrive < ApplicationRecord + has_paper_trail belongs_to :organization, optional: true include Filterable diff --git a/app/models/product_drive_participant.rb b/app/models/product_drive_participant.rb index 0b1f281763..f140a0811e 100644 --- a/app/models/product_drive_participant.rb +++ b/app/models/product_drive_participant.rb @@ -16,7 +16,8 @@ # organization_id :integer # -class ProductDriveParticipant < ApplicationRecord +class ProductDriveParticipant < ApplicationRecord + has_paper_trail include Provideable include Geocodable diff --git a/app/models/purchase.rb b/app/models/purchase.rb index 04d6f803b3..bdecb6014e 100644 --- a/app/models/purchase.rb +++ b/app/models/purchase.rb @@ -18,7 +18,8 @@ # vendor_id :integer # -class Purchase < ApplicationRecord +class Purchase < ApplicationRecord + has_paper_trail include MoneyRails::ActionViewExtension belongs_to :organization diff --git a/app/models/question.rb b/app/models/question.rb index f04588c62b..9246086dfa 100644 --- a/app/models/question.rb +++ b/app/models/question.rb @@ -9,7 +9,8 @@ # created_at :datetime not null # updated_at :datetime not null # -class Question < ApplicationRecord +class Question < ApplicationRecord + has_paper_trail has_rich_text :answer validates :answer, presence: true validates :title, presence: true diff --git a/app/models/request.rb b/app/models/request.rb index 1d9e05d950..a5836c8d2d 100644 --- a/app/models/request.rb +++ b/app/models/request.rb @@ -16,7 +16,8 @@ # partner_user_id :integer # -class Request < ApplicationRecord +class Request < ApplicationRecord + has_paper_trail include Discard::Model include Exportable diff --git a/app/models/role.rb b/app/models/role.rb index d0a4e6d012..eee125af78 100644 --- a/app/models/role.rb +++ b/app/models/role.rb @@ -10,7 +10,8 @@ # old_resource_id :bigint # resource_id :bigint # -class Role < ApplicationRecord +class Role < ApplicationRecord + has_paper_trail has_and_belongs_to_many :users, join_table: :users_roles accepts_nested_attributes_for :users diff --git a/app/models/storage_location.rb b/app/models/storage_location.rb index a5747f12bb..7c15e1c441 100644 --- a/app/models/storage_location.rb +++ b/app/models/storage_location.rb @@ -15,7 +15,8 @@ # updated_at :datetime not null # organization_id :integer # -class StorageLocation < ApplicationRecord +class StorageLocation < ApplicationRecord + has_paper_trail require "csv" WAREHOUSE_TYPES = [ diff --git a/app/models/transfer.rb b/app/models/transfer.rb index 4703bf0e84..1e87e93ea3 100644 --- a/app/models/transfer.rb +++ b/app/models/transfer.rb @@ -11,7 +11,8 @@ # to_id :integer # -class Transfer < ApplicationRecord +class Transfer < ApplicationRecord + has_paper_trail belongs_to :organization, inverse_of: :transfers belongs_to :from, class_name: "StorageLocation", inverse_of: :transfers_from belongs_to :to, class_name: "StorageLocation", inverse_of: :transfers_to diff --git a/app/models/user.rb b/app/models/user.rb index f3f953a3f3..41655c7cb0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -34,7 +34,8 @@ # partner_id :bigint # -class User < ApplicationRecord +class User < ApplicationRecord + has_paper_trail rolify include Discard::Model diff --git a/app/models/users_role.rb b/app/models/users_role.rb index 70ad96eace..de246a9dc6 100644 --- a/app/models/users_role.rb +++ b/app/models/users_role.rb @@ -6,7 +6,8 @@ # role_id :bigint # user_id :bigint # -class UsersRole < ApplicationRecord +class UsersRole < ApplicationRecord + has_paper_trail belongs_to :user belongs_to :role diff --git a/app/models/vendor.rb b/app/models/vendor.rb index 455ed09221..83f4b35467 100644 --- a/app/models/vendor.rb +++ b/app/models/vendor.rb @@ -16,7 +16,8 @@ # organization_id :integer # -class Vendor < ApplicationRecord +class Vendor < ApplicationRecord + has_paper_trail include Provideable include Geocodable From 614cfc092da0826eabf38a5d3d05e12b97330648 Mon Sep 17 00:00:00 2001 From: Ian Bulmer Date: Fri, 28 Jul 2023 12:12:02 -0400 Subject: [PATCH 2/8] remove duplication --- app/models/inventory_item.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/models/inventory_item.rb b/app/models/inventory_item.rb index 582621f0b7..b72401eb34 100644 --- a/app/models/inventory_item.rb +++ b/app/models/inventory_item.rb @@ -14,8 +14,6 @@ class InventoryItem < ApplicationRecord has_paper_trail MAX_INT = 2**31 - has_paper_trail - EARLIEST_VERSION = "2021-08-02" belongs_to :storage_location From e1896f9b2f083fd16003fc6dc11f93879f564779 Mon Sep 17 00:00:00 2001 From: Ian Bulmer Date: Fri, 28 Jul 2023 12:31:24 -0400 Subject: [PATCH 3/8] add paper trail test --- spec/models/account_request_spec.rb | 4 ++++ spec/rails_helper.rb | 1 + 2 files changed, 5 insertions(+) diff --git a/spec/models/account_request_spec.rb b/spec/models/account_request_spec.rb index 2bd99d37fb..960c1321f9 100644 --- a/spec/models/account_request_spec.rb +++ b/spec/models/account_request_spec.rb @@ -151,4 +151,8 @@ .with(account_request_id: account_request.id) expect(mail_double).to have_received(:deliver_later) end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index c971c74d51..1a34b46032 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -11,6 +11,7 @@ require "capybara-screenshot/rspec" require "pry" require 'knapsack_pro' +require 'paper_trail/frameworks/rspec' KnapsackPro::Adapters::RSpecAdapter.bind From 192ba2030075d245fbe4eee99b9355f4028e3db0 Mon Sep 17 00:00:00 2001 From: Ian Bulmer Date: Fri, 28 Jul 2023 15:04:04 -0400 Subject: [PATCH 4/8] added tests --- app/models/partners/base.rb | 1 - spec/models/account_request_spec.rb | 1 + spec/models/adjustment_spec.rb | 4 ++++ spec/models/audit_spec.rb | 4 ++++ spec/models/barcode_item_spec.rb | 4 ++++ spec/models/base_item_spec.rb | 4 ++++ spec/models/broadcast_announcement_spec.rb | 4 ++++ spec/models/county_spec.rb | 4 ++++ spec/models/distribution_spec.rb | 4 ++++ spec/models/donation_site_spec.rb | 4 ++++ spec/models/donation_spec.rb | 4 ++++ spec/models/inventory_item_spec.rb | 4 ++++ spec/models/item_category_spec.rb | 4 ++++ spec/models/item_spec.rb | 4 ++++ spec/models/kit_allocation_spec.rb | 4 ++++ spec/models/kit_spec.rb | 4 ++++ spec/models/line_item_spec.rb | 4 ++++ spec/models/manufacturer_spec.rb | 4 ++++ spec/models/ndbn_member_spec.rb | 4 ++++ spec/models/organization_spec.rb | 4 ++++ spec/models/partner_group_spec.rb | 4 ++++ spec/models/partner_spec.rb | 4 ++++ spec/models/product_drive_participant_spec.rb | 4 ++++ spec/models/product_drive_spec.rb | 4 ++++ spec/models/purchase_spec.rb | 4 ++++ spec/models/question_spec.rb | 4 ++++ spec/models/request_spec.rb | 4 ++++ spec/models/role_spec.rb | 4 ++++ spec/models/storage_location_spec.rb | 4 ++++ spec/models/transfer_spec.rb | 4 ++++ spec/models/user_spec.rb | 4 ++++ spec/models/users_role_spec.rb | 4 ++++ spec/models/vendor_spec.rb | 4 ++++ 33 files changed, 125 insertions(+), 1 deletion(-) diff --git a/app/models/partners/base.rb b/app/models/partners/base.rb index 459b297a82..f5b74c5bc1 100644 --- a/app/models/partners/base.rb +++ b/app/models/partners/base.rb @@ -1,6 +1,5 @@ module Partners class Base < ApplicationRecord - has_paper_trail self.abstract_class = true end end diff --git a/spec/models/account_request_spec.rb b/spec/models/account_request_spec.rb index 960c1321f9..db95cd9aad 100644 --- a/spec/models/account_request_spec.rb +++ b/spec/models/account_request_spec.rb @@ -152,6 +152,7 @@ expect(mail_double).to have_received(:deliver_later) end + describe 'versioning' do it { is_expected.to be_versioned } end diff --git a/spec/models/adjustment_spec.rb b/spec/models/adjustment_spec.rb index 5983205bae..494bdd907c 100644 --- a/spec/models/adjustment_spec.rb +++ b/spec/models/adjustment_spec.rb @@ -123,4 +123,8 @@ expect(new_adjustment.save).to be_truthy end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/audit_spec.rb b/spec/models/audit_spec.rb index c6eaf88cdf..c5964651e7 100644 --- a/spec/models/audit_spec.rb +++ b/spec/models/audit_spec.rb @@ -97,4 +97,8 @@ expect(Audit.storage_locations_audited_for(@organization).to_a).to match_array([storage_location1, storage_location2]) end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/barcode_item_spec.rb b/spec/models/barcode_item_spec.rb index 71b0f3267e..0e1f149856 100644 --- a/spec/models/barcode_item_spec.rb +++ b/spec/models/barcode_item_spec.rb @@ -206,4 +206,8 @@ end end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/base_item_spec.rb b/spec/models/base_item_spec.rb index a65b6e1f20..02cccdc7ed 100644 --- a/spec/models/base_item_spec.rb +++ b/spec/models/base_item_spec.rb @@ -63,4 +63,8 @@ end end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/broadcast_announcement_spec.rb b/spec/models/broadcast_announcement_spec.rb index f16714cc85..ea031275da 100644 --- a/spec/models/broadcast_announcement_spec.rb +++ b/spec/models/broadcast_announcement_spec.rb @@ -72,4 +72,8 @@ expect(BroadcastAnnouncement.filter_announcements(1).include?(announcement_3)).to be(false) end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/county_spec.rb b/spec/models/county_spec.rb index 6990206e40..9c491ec181 100644 --- a/spec/models/county_spec.rb +++ b/spec/models/county_spec.rb @@ -13,4 +13,8 @@ RSpec.describe County, type: :model do it { should have_many(:served_areas) } + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/distribution_spec.rb b/spec/models/distribution_spec.rb index ee9ebca6f8..b0e2dfd5d3 100644 --- a/spec/models/distribution_spec.rb +++ b/spec/models/distribution_spec.rb @@ -324,4 +324,8 @@ end end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/donation_site_spec.rb b/spec/models/donation_site_spec.rb index 75fd7ed3f0..4976abc406 100644 --- a/spec/models/donation_site_spec.rb +++ b/spec/models/donation_site_spec.rb @@ -45,4 +45,8 @@ expect(donation_site.longitude).not_to eq(nil) end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/donation_spec.rb b/spec/models/donation_spec.rb index a6bccb5268..f7058ea9b1 100644 --- a/spec/models/donation_spec.rb +++ b/spec/models/donation_spec.rb @@ -243,4 +243,8 @@ end end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/inventory_item_spec.rb b/spec/models/inventory_item_spec.rb index d3b2dc00e3..bab57c4c66 100644 --- a/spec/models/inventory_item_spec.rb +++ b/spec/models/inventory_item_spec.rb @@ -53,4 +53,8 @@ end end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/item_category_spec.rb b/spec/models/item_category_spec.rb index 2ed46cafae..e1ad473c14 100644 --- a/spec/models/item_category_spec.rb +++ b/spec/models/item_category_spec.rb @@ -26,4 +26,8 @@ it { should have_many(:items) } it { should have_and_belong_to_many(:partner_groups) } end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/item_spec.rb b/spec/models/item_spec.rb index 31bd7265da..46e20ffd19 100644 --- a/spec/models/item_spec.rb +++ b/spec/models/item_spec.rb @@ -247,4 +247,8 @@ end end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/kit_allocation_spec.rb b/spec/models/kit_allocation_spec.rb index 3d38ac1630..257ceddbe7 100644 --- a/spec/models/kit_allocation_spec.rb +++ b/spec/models/kit_allocation_spec.rb @@ -14,4 +14,8 @@ RSpec.describe KitAllocation, type: :model do pending "add some examples to (or delete) #{__FILE__}" + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/kit_spec.rb b/spec/models/kit_spec.rb index baf0d4d3bb..6adee21d3d 100644 --- a/spec/models/kit_spec.rb +++ b/spec/models/kit_spec.rb @@ -129,4 +129,8 @@ expect(kit.active).to eq(true) expect(kit.item.active).to eq(true) end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/line_item_spec.rb b/spec/models/line_item_spec.rb index 5422aea4ba..52f16b1bda 100644 --- a/spec/models/line_item_spec.rb +++ b/spec/models/line_item_spec.rb @@ -124,4 +124,8 @@ end end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/manufacturer_spec.rb b/spec/models/manufacturer_spec.rb index 99038ce067..609113593b 100644 --- a/spec/models/manufacturer_spec.rb +++ b/spec/models/manufacturer_spec.rb @@ -59,4 +59,8 @@ end end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/ndbn_member_spec.rb b/spec/models/ndbn_member_spec.rb index a7dbddffab..190af493a4 100644 --- a/spec/models/ndbn_member_spec.rb +++ b/spec/models/ndbn_member_spec.rb @@ -25,4 +25,8 @@ expect(subject).to eq("#{ndbn_member.ndbn_member_id} - #{ndbn_member.account_name}") end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/organization_spec.rb b/spec/models/organization_spec.rb index 1da46ccb4d..67c5d7b1ef 100644 --- a/spec/models/organization_spec.rb +++ b/spec/models/organization_spec.rb @@ -478,4 +478,8 @@ expect(org.earliest_reporting_year).to eq(7.years.ago.year) end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/partner_group_spec.rb b/spec/models/partner_group_spec.rb index c25695e4b5..df54773ba1 100644 --- a/spec/models/partner_group_spec.rb +++ b/spec/models/partner_group_spec.rb @@ -66,4 +66,8 @@ end end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/partner_spec.rb b/spec/models/partner_spec.rb index cee2072488..5945013bbc 100644 --- a/spec/models/partner_spec.rb +++ b/spec/models/partner_spec.rb @@ -338,4 +338,8 @@ it { is_expected.to eq({families_served: 0, children_served: 0, family_zipcodes: 0, family_zipcodes_list: []}) } end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/product_drive_participant_spec.rb b/spec/models/product_drive_participant_spec.rb index 8c85cc4cfd..97037045be 100644 --- a/spec/models/product_drive_participant_spec.rb +++ b/spec/models/product_drive_participant_spec.rb @@ -63,4 +63,8 @@ end end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/product_drive_spec.rb b/spec/models/product_drive_spec.rb index 316584422a..74f181159f 100644 --- a/spec/models/product_drive_spec.rb +++ b/spec/models/product_drive_spec.rb @@ -173,4 +173,8 @@ expect(product_drive.donation_source_view).to eq("Test Drive (product drive)") end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/purchase_spec.rb b/spec/models/purchase_spec.rb index a251681291..cb82001915 100644 --- a/spec/models/purchase_spec.rb +++ b/spec/models/purchase_spec.rb @@ -164,4 +164,8 @@ end end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/question_spec.rb b/spec/models/question_spec.rb index 6ba39b33c7..343237ae74 100644 --- a/spec/models/question_spec.rb +++ b/spec/models/question_spec.rb @@ -90,4 +90,8 @@ expect(question.punctuate(sentences)).to eq "This is a sentence. This is another sentence. This is a third sentence. " end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/request_spec.rb b/spec/models/request_spec.rb index 7b0ef28c7c..78cfe4aaf9 100644 --- a/spec/models/request_spec.rb +++ b/spec/models/request_spec.rb @@ -53,4 +53,8 @@ expect(request.total_items).to eq(33) end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/role_spec.rb b/spec/models/role_spec.rb index ec5e7e7840..115a0bc4d3 100644 --- a/spec/models/role_spec.rb +++ b/spec/models/role_spec.rb @@ -23,4 +23,8 @@ end it { should accept_nested_attributes_for :users } + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/storage_location_spec.rb b/spec/models/storage_location_spec.rb index 8d7faa9ace..e0139886a7 100644 --- a/spec/models/storage_location_spec.rb +++ b/spec/models/storage_location_spec.rb @@ -252,4 +252,8 @@ end end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/transfer_spec.rb b/spec/models/transfer_spec.rb index 26a64d63d1..ee2f2c4916 100644 --- a/spec/models/transfer_spec.rb +++ b/spec/models/transfer_spec.rb @@ -86,4 +86,8 @@ expect(Transfer.storage_locations_transferred_from_in(@organization).to_a).to match_array([storage_location3]) end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index efc8d7bc5b..6f914635d1 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -127,4 +127,8 @@ expect(described_class.from_omniauth(token)).to eq(user) end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/users_role_spec.rb b/spec/models/users_role_spec.rb index a7120f26ff..016157fbff 100644 --- a/spec/models/users_role_spec.rb +++ b/spec/models/users_role_spec.rb @@ -36,4 +36,8 @@ end end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/vendor_spec.rb b/spec/models/vendor_spec.rb index abe117e7a3..88a9a30d89 100644 --- a/spec/models/vendor_spec.rb +++ b/spec/models/vendor_spec.rb @@ -30,4 +30,8 @@ end end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end From b322238a1129ba3739930ee86be491c274e95025 Mon Sep 17 00:00:00 2001 From: Ian Bulmer Date: Fri, 28 Jul 2023 15:11:47 -0400 Subject: [PATCH 5/8] added specs --- app/models/partners/authorized_family_member.rb | 1 + app/models/partners/child.rb | 1 + app/models/partners/child_item_request.rb | 1 + app/models/partners/family.rb | 1 + app/models/partners/family_request.rb | 1 + app/models/partners/item_request.rb | 1 + app/models/partners/profile.rb | 1 + spec/models/partners/authorized_family_member_spec.rb | 4 ++++ spec/models/partners/child_item_request_spec.rb | 4 ++++ spec/models/partners/child_spec.rb | 4 ++++ spec/models/partners/family_spec.rb | 4 ++++ spec/models/partners/item_request_spec.rb | 4 ++++ spec/models/partners/profile_spec.rb | 4 ++++ spec/models/partners/served_area_spec.rb | 4 ++++ 14 files changed, 35 insertions(+) diff --git a/app/models/partners/authorized_family_member.rb b/app/models/partners/authorized_family_member.rb index c1ebd49cba..efa60b2626 100644 --- a/app/models/partners/authorized_family_member.rb +++ b/app/models/partners/authorized_family_member.rb @@ -14,6 +14,7 @@ # module Partners class AuthorizedFamilyMember < Base + has_paper_trail belongs_to :family has_many :child_item_requests, dependent: :nullify diff --git a/app/models/partners/child.rb b/app/models/partners/child.rb index a81ad7f080..1421bd47a1 100644 --- a/app/models/partners/child.rb +++ b/app/models/partners/child.rb @@ -21,6 +21,7 @@ # module Partners class Child < Base + has_paper_trail serialize :child_lives_with, Array belongs_to :family has_many :child_item_requests, dependent: :destroy diff --git a/app/models/partners/child_item_request.rb b/app/models/partners/child_item_request.rb index 0caf89b814..b52a5b39e6 100644 --- a/app/models/partners/child_item_request.rb +++ b/app/models/partners/child_item_request.rb @@ -14,6 +14,7 @@ # module Partners class ChildItemRequest < Base + has_paper_trail belongs_to :item_request belongs_to :child belongs_to :authorized_family_member, optional: true diff --git a/app/models/partners/family.rb b/app/models/partners/family.rb index c7ad7dae93..54193a44e4 100644 --- a/app/models/partners/family.rb +++ b/app/models/partners/family.rb @@ -26,6 +26,7 @@ # module Partners class Family < Base + has_paper_trail belongs_to :partner, class_name: '::Partner' has_many :children, dependent: :destroy has_many :authorized_family_members, dependent: :destroy diff --git a/app/models/partners/family_request.rb b/app/models/partners/family_request.rb index e030fe7fb0..815e814ddc 100644 --- a/app/models/partners/family_request.rb +++ b/app/models/partners/family_request.rb @@ -1,6 +1,7 @@ module Partners class FamilyRequest include ActiveModel::Model + has_paper_trail attr_accessor :comments, :partner attr_reader :items diff --git a/app/models/partners/item_request.rb b/app/models/partners/item_request.rb index c996bc8936..0232589b43 100644 --- a/app/models/partners/item_request.rb +++ b/app/models/partners/item_request.rb @@ -14,6 +14,7 @@ # module Partners class ItemRequest < Base + has_paper_trail belongs_to :request, class_name: '::Request', foreign_key: :partner_request_id, inverse_of: :item_requests has_many :child_item_requests, dependent: :destroy has_many :children, through: :child_item_requests diff --git a/app/models/partners/profile.rb b/app/models/partners/profile.rb index 37f6b18ce4..296204397b 100644 --- a/app/models/partners/profile.rb +++ b/app/models/partners/profile.rb @@ -81,6 +81,7 @@ # module Partners class Profile < Base + has_paper_trail self.table_name = "partner_profiles" belongs_to :partner has_one :organization, through: :partner, class_name: "::Organization" diff --git a/spec/models/partners/authorized_family_member_spec.rb b/spec/models/partners/authorized_family_member_spec.rb index c6ef411338..b4a0e927e7 100644 --- a/spec/models/partners/authorized_family_member_spec.rb +++ b/spec/models/partners/authorized_family_member_spec.rb @@ -28,6 +28,10 @@ expect(authorized_family_member.display_name).to eq("#{authorized_family_member.first_name} #{authorized_family_member.last_name}") end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/partners/child_item_request_spec.rb b/spec/models/partners/child_item_request_spec.rb index bb50a072d8..0bc9d00f43 100644 --- a/spec/models/partners/child_item_request_spec.rb +++ b/spec/models/partners/child_item_request_spec.rb @@ -48,4 +48,8 @@ expect(subject).to eq(item_id) end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/partners/child_spec.rb b/spec/models/partners/child_spec.rb index 293981793e..e72f6f2bce 100644 --- a/spec/models/partners/child_spec.rb +++ b/spec/models/partners/child_spec.rb @@ -35,4 +35,8 @@ expect(subject.display_name).to eq("#{subject.first_name} #{subject.last_name}") end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/partners/family_spec.rb b/spec/models/partners/family_spec.rb index 8248a689c6..5eb32a0d99 100644 --- a/spec/models/partners/family_spec.rb +++ b/spec/models/partners/family_spec.rb @@ -70,4 +70,8 @@ expect(subject.total_children_count).to eq(subject.home_child_count + subject.home_young_child_count) end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/partners/item_request_spec.rb b/spec/models/partners/item_request_spec.rb index d96c4a9d26..0a5c37dfee 100644 --- a/spec/models/partners/item_request_spec.rb +++ b/spec/models/partners/item_request_spec.rb @@ -27,6 +27,10 @@ it { should validate_presence_of(:name) } it { should validate_presence_of(:partner_key) } end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/partners/profile_spec.rb b/spec/models/partners/profile_spec.rb index f73e4c1f4f..1bfa688fec 100644 --- a/spec/models/partners/profile_spec.rb +++ b/spec/models/partners/profile_spec.rb @@ -201,4 +201,8 @@ end end end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end diff --git a/spec/models/partners/served_area_spec.rb b/spec/models/partners/served_area_spec.rb index e5cdf0e913..dc1381d9ca 100644 --- a/spec/models/partners/served_area_spec.rb +++ b/spec/models/partners/served_area_spec.rb @@ -26,4 +26,8 @@ expect(build(:partners_served_area, partner_profile: create(:partner_profile), county: create(:county), client_share: 1)).to be_valid expect(build(:partners_served_area, partner_profile: create(:partner_profile), county: create(:county), client_share: 100)).to be_valid end + + describe 'versioning' do + it { is_expected.to be_versioned } + end end From 92565ae87f36fbacf4e5fc5b8e3faee3c4251ef0 Mon Sep 17 00:00:00 2001 From: Ian Bulmer Date: Fri, 28 Jul 2023 15:38:13 -0400 Subject: [PATCH 6/8] rubocop --- app/models/account_request.rb | 2 +- app/models/adjustment.rb | 2 +- app/models/annual_report.rb | 2 +- app/models/audit.rb | 2 +- app/models/barcode_item.rb | 2 +- app/models/base_item.rb | 2 +- app/models/broadcast_announcement.rb | 2 +- app/models/county.rb | 2 +- app/models/distribution.rb | 2 +- app/models/donation.rb | 2 +- app/models/donation_site.rb | 2 +- app/models/inventory_item.rb | 2 +- app/models/item.rb | 2 +- app/models/item_category.rb | 2 +- app/models/kit.rb | 2 +- app/models/kit_allocation.rb | 2 +- app/models/line_item.rb | 2 +- app/models/manufacturer.rb | 2 +- app/models/ndbn_member.rb | 2 +- app/models/organization.rb | 2 +- app/models/partner.rb | 2 +- app/models/partner_group.rb | 2 +- app/models/partners/base.rb | 2 +- app/models/partners/family_request.rb | 1 - app/models/partners/served_area.rb | 4 ++-- app/models/product_drive.rb | 2 +- app/models/product_drive_participant.rb | 2 +- app/models/purchase.rb | 2 +- app/models/question.rb | 2 +- app/models/request.rb | 2 +- app/models/role.rb | 2 +- app/models/storage_location.rb | 2 +- app/models/transfer.rb | 2 +- app/models/user.rb | 2 +- app/models/users_role.rb | 2 +- app/models/vendor.rb | 2 +- spec/models/account_request_spec.rb | 3 +-- spec/models/adjustment_spec.rb | 2 +- spec/models/audit_spec.rb | 2 +- spec/models/barcode_item_spec.rb | 2 +- spec/models/base_item_spec.rb | 2 +- spec/models/broadcast_announcement_spec.rb | 2 +- spec/models/county_spec.rb | 2 +- spec/models/distribution_spec.rb | 2 +- spec/models/donation_site_spec.rb | 2 +- spec/models/donation_spec.rb | 2 +- spec/models/inventory_item_spec.rb | 2 +- spec/models/item_category_spec.rb | 2 +- spec/models/item_spec.rb | 2 +- spec/models/kit_allocation_spec.rb | 2 +- spec/models/kit_spec.rb | 2 +- spec/models/line_item_spec.rb | 2 +- spec/models/manufacturer_spec.rb | 2 +- spec/models/ndbn_member_spec.rb | 2 +- spec/models/organization_spec.rb | 2 +- spec/models/partner_group_spec.rb | 2 +- spec/models/partner_spec.rb | 2 +- spec/models/partners/authorized_family_member_spec.rb | 2 +- spec/models/partners/child_item_request_spec.rb | 2 +- spec/models/partners/child_spec.rb | 2 +- spec/models/partners/family_spec.rb | 2 +- spec/models/partners/item_request_spec.rb | 2 +- spec/models/partners/profile_spec.rb | 2 +- spec/models/partners/served_area_spec.rb | 2 +- spec/models/product_drive_participant_spec.rb | 2 +- spec/models/product_drive_spec.rb | 2 +- spec/models/purchase_spec.rb | 2 +- spec/models/question_spec.rb | 2 +- spec/models/request_spec.rb | 2 +- spec/models/role_spec.rb | 2 +- spec/models/storage_location_spec.rb | 2 +- spec/models/transfer_spec.rb | 2 +- spec/models/user_spec.rb | 2 +- spec/models/users_role_spec.rb | 2 +- spec/models/vendor_spec.rb | 2 +- 75 files changed, 75 insertions(+), 77 deletions(-) diff --git a/app/models/account_request.rb b/app/models/account_request.rb index c4a2f619d3..6845565671 100644 --- a/app/models/account_request.rb +++ b/app/models/account_request.rb @@ -15,7 +15,7 @@ # updated_at :datetime not null # ndbn_member_id :bigint # -class AccountRequest < ApplicationRecord +class AccountRequest < ApplicationRecord has_paper_trail validates :name, presence: true validates :email, presence: true, uniqueness: true diff --git a/app/models/adjustment.rb b/app/models/adjustment.rb index dfff1ffbc2..20d4268bc8 100644 --- a/app/models/adjustment.rb +++ b/app/models/adjustment.rb @@ -11,7 +11,7 @@ # user_id :bigint # -class Adjustment < ApplicationRecord +class Adjustment < ApplicationRecord has_paper_trail belongs_to :organization belongs_to :storage_location diff --git a/app/models/annual_report.rb b/app/models/annual_report.rb index 74ea7a98eb..39adb554ba 100644 --- a/app/models/annual_report.rb +++ b/app/models/annual_report.rb @@ -9,7 +9,7 @@ # updated_at :datetime not null # organization_id :bigint # -class AnnualReport < ApplicationRecord +class AnnualReport < ApplicationRecord has_paper_trail belongs_to :organization, inverse_of: :annual_reports validates :year, numericality: { greater_than: 1900, less_than: 10_000 } diff --git a/app/models/audit.rb b/app/models/audit.rb index 5dec7f6d19..f8ed3b163a 100644 --- a/app/models/audit.rb +++ b/app/models/audit.rb @@ -12,7 +12,7 @@ # user_id :bigint # -class Audit < ApplicationRecord +class Audit < ApplicationRecord has_paper_trail belongs_to :user belongs_to :organization diff --git a/app/models/barcode_item.rb b/app/models/barcode_item.rb index ac186bf7e4..025b1195c8 100644 --- a/app/models/barcode_item.rb +++ b/app/models/barcode_item.rb @@ -12,7 +12,7 @@ # organization_id :integer # -class BarcodeItem < ApplicationRecord +class BarcodeItem < ApplicationRecord has_paper_trail belongs_to :organization, optional: true belongs_to :barcodeable, polymorphic: true, dependent: :destroy, counter_cache: :barcode_count diff --git a/app/models/base_item.rb b/app/models/base_item.rb index c9455dbc9a..d910a46f25 100644 --- a/app/models/base_item.rb +++ b/app/models/base_item.rb @@ -13,7 +13,7 @@ # updated_at :datetime not null # -class BaseItem < ApplicationRecord +class BaseItem < ApplicationRecord has_paper_trail has_many :items, dependent: :destroy, inverse_of: :base_item, foreign_key: :partner_key, primary_key: :partner_key has_many :barcode_items, as: :barcodeable, dependent: :destroy diff --git a/app/models/broadcast_announcement.rb b/app/models/broadcast_announcement.rb index 6352692553..e1818f572f 100644 --- a/app/models/broadcast_announcement.rb +++ b/app/models/broadcast_announcement.rb @@ -11,7 +11,7 @@ # organization_id :bigint # user_id :bigint not null # -class BroadcastAnnouncement < ApplicationRecord +class BroadcastAnnouncement < ApplicationRecord has_paper_trail belongs_to :user belongs_to :organization, optional: true diff --git a/app/models/county.rb b/app/models/county.rb index 4bb4153080..5be8fe402e 100644 --- a/app/models/county.rb +++ b/app/models/county.rb @@ -9,7 +9,7 @@ # created_at :datetime not null # updated_at :datetime not null # -class County < ApplicationRecord +class County < ApplicationRecord has_paper_trail has_many :served_areas, class_name: "Partners::ServedArea", dependent: :destroy diff --git a/app/models/distribution.rb b/app/models/distribution.rb index 2706987f19..4626249b7a 100644 --- a/app/models/distribution.rb +++ b/app/models/distribution.rb @@ -18,7 +18,7 @@ # storage_location_id :integer # -class Distribution < ApplicationRecord +class Distribution < ApplicationRecord has_paper_trail # Distributions are issued from a single storage location, so we associate # them so that on-hand amounts can be verified diff --git a/app/models/donation.rb b/app/models/donation.rb index 12155e12e8..35120311e5 100644 --- a/app/models/donation.rb +++ b/app/models/donation.rb @@ -17,7 +17,7 @@ # storage_location_id :integer # -class Donation < ApplicationRecord +class Donation < ApplicationRecord has_paper_trail SOURCES = { product_drive: "Product Drive", manufacturer: "Manufacturer", diff --git a/app/models/donation_site.rb b/app/models/donation_site.rb index 80ee3e2e64..2732adb679 100644 --- a/app/models/donation_site.rb +++ b/app/models/donation_site.rb @@ -12,7 +12,7 @@ # organization_id :integer # -class DonationSite < ApplicationRecord +class DonationSite < ApplicationRecord has_paper_trail require "csv" diff --git a/app/models/inventory_item.rb b/app/models/inventory_item.rb index b72401eb34..f038656ad6 100644 --- a/app/models/inventory_item.rb +++ b/app/models/inventory_item.rb @@ -10,7 +10,7 @@ # storage_location_id :integer # -class InventoryItem < ApplicationRecord +class InventoryItem < ApplicationRecord has_paper_trail MAX_INT = 2**31 diff --git a/app/models/item.rb b/app/models/item.rb index ad323f75cf..0c7b8366d9 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -21,7 +21,7 @@ # organization_id :integer # -class Item < ApplicationRecord +class Item < ApplicationRecord has_paper_trail include Filterable include Exportable diff --git a/app/models/item_category.rb b/app/models/item_category.rb index 0b01ac1d16..c005bfe9b7 100644 --- a/app/models/item_category.rb +++ b/app/models/item_category.rb @@ -9,7 +9,7 @@ # updated_at :datetime not null # organization_id :integer not null # -class ItemCategory < ApplicationRecord +class ItemCategory < ApplicationRecord has_paper_trail validates :name, presence: true, uniqueness: { scope: :organization_id } validates :organization, presence: true diff --git a/app/models/kit.rb b/app/models/kit.rb index ed391426c0..88098cfb12 100644 --- a/app/models/kit.rb +++ b/app/models/kit.rb @@ -11,7 +11,7 @@ # updated_at :datetime not null # organization_id :integer not null # -class Kit < ApplicationRecord +class Kit < ApplicationRecord has_paper_trail include Itemizable include Filterable diff --git a/app/models/kit_allocation.rb b/app/models/kit_allocation.rb index 7f2e86608f..d0c5f1c17d 100644 --- a/app/models/kit_allocation.rb +++ b/app/models/kit_allocation.rb @@ -10,7 +10,7 @@ # organization_id :bigint not null # storage_location_id :bigint not null # -class KitAllocation < ApplicationRecord +class KitAllocation < ApplicationRecord has_paper_trail include Itemizable belongs_to :storage_location diff --git a/app/models/line_item.rb b/app/models/line_item.rb index 76c3068031..36cb1d7a17 100644 --- a/app/models/line_item.rb +++ b/app/models/line_item.rb @@ -11,7 +11,7 @@ # itemizable_id :integer # -class LineItem < ApplicationRecord +class LineItem < ApplicationRecord has_paper_trail include ItemQuantity MAX_INT = 2**31 diff --git a/app/models/manufacturer.rb b/app/models/manufacturer.rb index abaf9b101a..3a274fefa8 100644 --- a/app/models/manufacturer.rb +++ b/app/models/manufacturer.rb @@ -9,7 +9,7 @@ # organization_id :bigint # -class Manufacturer < ApplicationRecord +class Manufacturer < ApplicationRecord has_paper_trail belongs_to :organization diff --git a/app/models/ndbn_member.rb b/app/models/ndbn_member.rb index 170adae01d..572b7ebcf4 100644 --- a/app/models/ndbn_member.rb +++ b/app/models/ndbn_member.rb @@ -7,7 +7,7 @@ # updated_at :datetime not null # ndbn_member_id :bigint not null, primary key # -class NDBNMember < ApplicationRecord +class NDBNMember < ApplicationRecord has_paper_trail self.primary_key = "ndbn_member_id" diff --git a/app/models/organization.rb b/app/models/organization.rb index e58a3aa172..36911b60da 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -30,7 +30,7 @@ # ndbn_member_id :bigint # -class Organization < ApplicationRecord +class Organization < ApplicationRecord has_paper_trail resourcify diff --git a/app/models/partner.rb b/app/models/partner.rb index b83519505a..23c8dec134 100644 --- a/app/models/partner.rb +++ b/app/models/partner.rb @@ -16,7 +16,7 @@ # partner_group_id :bigint # -class Partner < ApplicationRecord +class Partner < ApplicationRecord has_paper_trail resourcify require "csv" diff --git a/app/models/partner_group.rb b/app/models/partner_group.rb index a9cf3e63ff..e7ac55c8fd 100644 --- a/app/models/partner_group.rb +++ b/app/models/partner_group.rb @@ -11,7 +11,7 @@ # updated_at :datetime not null # organization_id :bigint # -class PartnerGroup < ApplicationRecord +class PartnerGroup < ApplicationRecord has_paper_trail include Deadlinable diff --git a/app/models/partners/base.rb b/app/models/partners/base.rb index f5b74c5bc1..701b69f1aa 100644 --- a/app/models/partners/base.rb +++ b/app/models/partners/base.rb @@ -1,5 +1,5 @@ module Partners - class Base < ApplicationRecord + class Base < ApplicationRecord self.abstract_class = true end end diff --git a/app/models/partners/family_request.rb b/app/models/partners/family_request.rb index 815e814ddc..e030fe7fb0 100644 --- a/app/models/partners/family_request.rb +++ b/app/models/partners/family_request.rb @@ -1,7 +1,6 @@ module Partners class FamilyRequest include ActiveModel::Model - has_paper_trail attr_accessor :comments, :partner attr_reader :items diff --git a/app/models/partners/served_area.rb b/app/models/partners/served_area.rb index 41239f1bcc..5fa2ea92a5 100644 --- a/app/models/partners/served_area.rb +++ b/app/models/partners/served_area.rb @@ -10,8 +10,8 @@ # partner_profile_id :bigint not null # module Partners - class ServedArea < ApplicationRecord - has_paper_trail + class ServedArea < ApplicationRecord + has_paper_trail self.table_name = "partner_served_areas" belongs_to :partner_profile, class_name: "Partners::Profile" belongs_to :county diff --git a/app/models/product_drive.rb b/app/models/product_drive.rb index 8b43f34804..f9fdbfa5ce 100644 --- a/app/models/product_drive.rb +++ b/app/models/product_drive.rb @@ -12,7 +12,7 @@ # organization_id :bigint # -class ProductDrive < ApplicationRecord +class ProductDrive < ApplicationRecord has_paper_trail belongs_to :organization, optional: true include Filterable diff --git a/app/models/product_drive_participant.rb b/app/models/product_drive_participant.rb index f140a0811e..057c89844e 100644 --- a/app/models/product_drive_participant.rb +++ b/app/models/product_drive_participant.rb @@ -16,7 +16,7 @@ # organization_id :integer # -class ProductDriveParticipant < ApplicationRecord +class ProductDriveParticipant < ApplicationRecord has_paper_trail include Provideable include Geocodable diff --git a/app/models/purchase.rb b/app/models/purchase.rb index bdecb6014e..4cfa2bb0fd 100644 --- a/app/models/purchase.rb +++ b/app/models/purchase.rb @@ -18,7 +18,7 @@ # vendor_id :integer # -class Purchase < ApplicationRecord +class Purchase < ApplicationRecord has_paper_trail include MoneyRails::ActionViewExtension diff --git a/app/models/question.rb b/app/models/question.rb index 9246086dfa..44aff38cc5 100644 --- a/app/models/question.rb +++ b/app/models/question.rb @@ -9,7 +9,7 @@ # created_at :datetime not null # updated_at :datetime not null # -class Question < ApplicationRecord +class Question < ApplicationRecord has_paper_trail has_rich_text :answer validates :answer, presence: true diff --git a/app/models/request.rb b/app/models/request.rb index a5836c8d2d..c6963aeeb3 100644 --- a/app/models/request.rb +++ b/app/models/request.rb @@ -16,7 +16,7 @@ # partner_user_id :integer # -class Request < ApplicationRecord +class Request < ApplicationRecord has_paper_trail include Discard::Model include Exportable diff --git a/app/models/role.rb b/app/models/role.rb index eee125af78..474cb50e64 100644 --- a/app/models/role.rb +++ b/app/models/role.rb @@ -10,7 +10,7 @@ # old_resource_id :bigint # resource_id :bigint # -class Role < ApplicationRecord +class Role < ApplicationRecord has_paper_trail has_and_belongs_to_many :users, join_table: :users_roles accepts_nested_attributes_for :users diff --git a/app/models/storage_location.rb b/app/models/storage_location.rb index 7c15e1c441..f472fce528 100644 --- a/app/models/storage_location.rb +++ b/app/models/storage_location.rb @@ -15,7 +15,7 @@ # updated_at :datetime not null # organization_id :integer # -class StorageLocation < ApplicationRecord +class StorageLocation < ApplicationRecord has_paper_trail require "csv" diff --git a/app/models/transfer.rb b/app/models/transfer.rb index 1e87e93ea3..61f623ea6e 100644 --- a/app/models/transfer.rb +++ b/app/models/transfer.rb @@ -11,7 +11,7 @@ # to_id :integer # -class Transfer < ApplicationRecord +class Transfer < ApplicationRecord has_paper_trail belongs_to :organization, inverse_of: :transfers belongs_to :from, class_name: "StorageLocation", inverse_of: :transfers_from diff --git a/app/models/user.rb b/app/models/user.rb index 41655c7cb0..5280b3cb9c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -34,7 +34,7 @@ # partner_id :bigint # -class User < ApplicationRecord +class User < ApplicationRecord has_paper_trail rolify include Discard::Model diff --git a/app/models/users_role.rb b/app/models/users_role.rb index de246a9dc6..4432d445b8 100644 --- a/app/models/users_role.rb +++ b/app/models/users_role.rb @@ -6,7 +6,7 @@ # role_id :bigint # user_id :bigint # -class UsersRole < ApplicationRecord +class UsersRole < ApplicationRecord has_paper_trail belongs_to :user belongs_to :role diff --git a/app/models/vendor.rb b/app/models/vendor.rb index 83f4b35467..ac264db394 100644 --- a/app/models/vendor.rb +++ b/app/models/vendor.rb @@ -16,7 +16,7 @@ # organization_id :integer # -class Vendor < ApplicationRecord +class Vendor < ApplicationRecord has_paper_trail include Provideable include Geocodable diff --git a/spec/models/account_request_spec.rb b/spec/models/account_request_spec.rb index db95cd9aad..5d64327543 100644 --- a/spec/models/account_request_spec.rb +++ b/spec/models/account_request_spec.rb @@ -151,9 +151,8 @@ .with(account_request_id: account_request.id) expect(mail_double).to have_received(:deliver_later) end - - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/adjustment_spec.rb b/spec/models/adjustment_spec.rb index 494bdd907c..b27a6df877 100644 --- a/spec/models/adjustment_spec.rb +++ b/spec/models/adjustment_spec.rb @@ -124,7 +124,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/audit_spec.rb b/spec/models/audit_spec.rb index c5964651e7..6374c84c82 100644 --- a/spec/models/audit_spec.rb +++ b/spec/models/audit_spec.rb @@ -98,7 +98,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/barcode_item_spec.rb b/spec/models/barcode_item_spec.rb index 0e1f149856..15df046aab 100644 --- a/spec/models/barcode_item_spec.rb +++ b/spec/models/barcode_item_spec.rb @@ -207,7 +207,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/base_item_spec.rb b/spec/models/base_item_spec.rb index 02cccdc7ed..9d9a17185c 100644 --- a/spec/models/base_item_spec.rb +++ b/spec/models/base_item_spec.rb @@ -64,7 +64,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/broadcast_announcement_spec.rb b/spec/models/broadcast_announcement_spec.rb index ea031275da..f06e6f74de 100644 --- a/spec/models/broadcast_announcement_spec.rb +++ b/spec/models/broadcast_announcement_spec.rb @@ -73,7 +73,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/county_spec.rb b/spec/models/county_spec.rb index 9c491ec181..8275ea629d 100644 --- a/spec/models/county_spec.rb +++ b/spec/models/county_spec.rb @@ -14,7 +14,7 @@ RSpec.describe County, type: :model do it { should have_many(:served_areas) } - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/distribution_spec.rb b/spec/models/distribution_spec.rb index b0e2dfd5d3..a4881a44d6 100644 --- a/spec/models/distribution_spec.rb +++ b/spec/models/distribution_spec.rb @@ -325,7 +325,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/donation_site_spec.rb b/spec/models/donation_site_spec.rb index 4976abc406..d1040e468e 100644 --- a/spec/models/donation_site_spec.rb +++ b/spec/models/donation_site_spec.rb @@ -46,7 +46,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/donation_spec.rb b/spec/models/donation_spec.rb index f7058ea9b1..4151d06e04 100644 --- a/spec/models/donation_spec.rb +++ b/spec/models/donation_spec.rb @@ -244,7 +244,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/inventory_item_spec.rb b/spec/models/inventory_item_spec.rb index bab57c4c66..8cbfee0cda 100644 --- a/spec/models/inventory_item_spec.rb +++ b/spec/models/inventory_item_spec.rb @@ -54,7 +54,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/item_category_spec.rb b/spec/models/item_category_spec.rb index e1ad473c14..461ee5bc46 100644 --- a/spec/models/item_category_spec.rb +++ b/spec/models/item_category_spec.rb @@ -27,7 +27,7 @@ it { should have_and_belong_to_many(:partner_groups) } end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/item_spec.rb b/spec/models/item_spec.rb index 46e20ffd19..920e674fe7 100644 --- a/spec/models/item_spec.rb +++ b/spec/models/item_spec.rb @@ -248,7 +248,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/kit_allocation_spec.rb b/spec/models/kit_allocation_spec.rb index 257ceddbe7..df81233896 100644 --- a/spec/models/kit_allocation_spec.rb +++ b/spec/models/kit_allocation_spec.rb @@ -15,7 +15,7 @@ RSpec.describe KitAllocation, type: :model do pending "add some examples to (or delete) #{__FILE__}" - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/kit_spec.rb b/spec/models/kit_spec.rb index 6adee21d3d..07a0a53fec 100644 --- a/spec/models/kit_spec.rb +++ b/spec/models/kit_spec.rb @@ -130,7 +130,7 @@ expect(kit.item.active).to eq(true) end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/line_item_spec.rb b/spec/models/line_item_spec.rb index 52f16b1bda..1fe9ac6a03 100644 --- a/spec/models/line_item_spec.rb +++ b/spec/models/line_item_spec.rb @@ -125,7 +125,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/manufacturer_spec.rb b/spec/models/manufacturer_spec.rb index 609113593b..623723a8d2 100644 --- a/spec/models/manufacturer_spec.rb +++ b/spec/models/manufacturer_spec.rb @@ -60,7 +60,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/ndbn_member_spec.rb b/spec/models/ndbn_member_spec.rb index 190af493a4..30a54ccaf7 100644 --- a/spec/models/ndbn_member_spec.rb +++ b/spec/models/ndbn_member_spec.rb @@ -26,7 +26,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/organization_spec.rb b/spec/models/organization_spec.rb index 67c5d7b1ef..0643970d1a 100644 --- a/spec/models/organization_spec.rb +++ b/spec/models/organization_spec.rb @@ -479,7 +479,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/partner_group_spec.rb b/spec/models/partner_group_spec.rb index df54773ba1..421ebf9f54 100644 --- a/spec/models/partner_group_spec.rb +++ b/spec/models/partner_group_spec.rb @@ -67,7 +67,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/partner_spec.rb b/spec/models/partner_spec.rb index 5945013bbc..5f7f97b4be 100644 --- a/spec/models/partner_spec.rb +++ b/spec/models/partner_spec.rb @@ -339,7 +339,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/partners/authorized_family_member_spec.rb b/spec/models/partners/authorized_family_member_spec.rb index b4a0e927e7..94c7711d07 100644 --- a/spec/models/partners/authorized_family_member_spec.rb +++ b/spec/models/partners/authorized_family_member_spec.rb @@ -29,7 +29,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/partners/child_item_request_spec.rb b/spec/models/partners/child_item_request_spec.rb index 0bc9d00f43..f5599a1372 100644 --- a/spec/models/partners/child_item_request_spec.rb +++ b/spec/models/partners/child_item_request_spec.rb @@ -49,7 +49,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/partners/child_spec.rb b/spec/models/partners/child_spec.rb index e72f6f2bce..c8ace29762 100644 --- a/spec/models/partners/child_spec.rb +++ b/spec/models/partners/child_spec.rb @@ -36,7 +36,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/partners/family_spec.rb b/spec/models/partners/family_spec.rb index 5eb32a0d99..0422935e13 100644 --- a/spec/models/partners/family_spec.rb +++ b/spec/models/partners/family_spec.rb @@ -71,7 +71,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/partners/item_request_spec.rb b/spec/models/partners/item_request_spec.rb index 0a5c37dfee..1034e4c162 100644 --- a/spec/models/partners/item_request_spec.rb +++ b/spec/models/partners/item_request_spec.rb @@ -28,7 +28,7 @@ it { should validate_presence_of(:partner_key) } end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/partners/profile_spec.rb b/spec/models/partners/profile_spec.rb index 1bfa688fec..e257b496bf 100644 --- a/spec/models/partners/profile_spec.rb +++ b/spec/models/partners/profile_spec.rb @@ -202,7 +202,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/partners/served_area_spec.rb b/spec/models/partners/served_area_spec.rb index dc1381d9ca..ad65d38066 100644 --- a/spec/models/partners/served_area_spec.rb +++ b/spec/models/partners/served_area_spec.rb @@ -27,7 +27,7 @@ expect(build(:partners_served_area, partner_profile: create(:partner_profile), county: create(:county), client_share: 100)).to be_valid end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/product_drive_participant_spec.rb b/spec/models/product_drive_participant_spec.rb index 97037045be..42652c381e 100644 --- a/spec/models/product_drive_participant_spec.rb +++ b/spec/models/product_drive_participant_spec.rb @@ -64,7 +64,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/product_drive_spec.rb b/spec/models/product_drive_spec.rb index 74f181159f..103828fdb8 100644 --- a/spec/models/product_drive_spec.rb +++ b/spec/models/product_drive_spec.rb @@ -174,7 +174,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/purchase_spec.rb b/spec/models/purchase_spec.rb index cb82001915..842836e716 100644 --- a/spec/models/purchase_spec.rb +++ b/spec/models/purchase_spec.rb @@ -165,7 +165,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/question_spec.rb b/spec/models/question_spec.rb index 343237ae74..183ca22163 100644 --- a/spec/models/question_spec.rb +++ b/spec/models/question_spec.rb @@ -91,7 +91,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/request_spec.rb b/spec/models/request_spec.rb index 78cfe4aaf9..a396f847ee 100644 --- a/spec/models/request_spec.rb +++ b/spec/models/request_spec.rb @@ -54,7 +54,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/role_spec.rb b/spec/models/role_spec.rb index 115a0bc4d3..6028c95a00 100644 --- a/spec/models/role_spec.rb +++ b/spec/models/role_spec.rb @@ -24,7 +24,7 @@ it { should accept_nested_attributes_for :users } - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/storage_location_spec.rb b/spec/models/storage_location_spec.rb index e0139886a7..252c2e947f 100644 --- a/spec/models/storage_location_spec.rb +++ b/spec/models/storage_location_spec.rb @@ -253,7 +253,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/transfer_spec.rb b/spec/models/transfer_spec.rb index ee2f2c4916..30990c33ee 100644 --- a/spec/models/transfer_spec.rb +++ b/spec/models/transfer_spec.rb @@ -87,7 +87,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 6f914635d1..c7f850a792 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -128,7 +128,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/users_role_spec.rb b/spec/models/users_role_spec.rb index 016157fbff..5f2a0c3f1e 100644 --- a/spec/models/users_role_spec.rb +++ b/spec/models/users_role_spec.rb @@ -37,7 +37,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end diff --git a/spec/models/vendor_spec.rb b/spec/models/vendor_spec.rb index 88a9a30d89..a32015a269 100644 --- a/spec/models/vendor_spec.rb +++ b/spec/models/vendor_spec.rb @@ -31,7 +31,7 @@ end end - describe 'versioning' do + describe "versioning" do it { is_expected.to be_versioned } end end From 470f25fbfc559bf8f8904c23c5b29f421dcdbe0e Mon Sep 17 00:00:00 2001 From: Ian Bulmer Date: Fri, 28 Jul 2023 17:17:37 -0400 Subject: [PATCH 7/8] remove paper_traol/frameworks/rspec --- spec/rails_helper.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 1a34b46032..c971c74d51 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -11,7 +11,6 @@ require "capybara-screenshot/rspec" require "pry" require 'knapsack_pro' -require 'paper_trail/frameworks/rspec' KnapsackPro::Adapters::RSpecAdapter.bind From ee32a6bc44640d6f0d274acdc15977dd1f28a9f4 Mon Sep 17 00:00:00 2001 From: Ian Bulmer Date: Fri, 28 Jul 2023 17:20:45 -0400 Subject: [PATCH 8/8] add but disable paper_traol/frameworks/rspec --- spec/rails_helper.rb | 3 ++- spec/requests/storage_locations_requests_spec.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index c971c74d51..b6cd0c983b 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -11,6 +11,7 @@ require "capybara-screenshot/rspec" require "pry" require 'knapsack_pro' +require 'paper_trail/frameworks/rspec' KnapsackPro::Adapters::RSpecAdapter.bind @@ -52,7 +53,7 @@ capabilities.add_preference(:download, prompt_for_download: false, default_directory: DownloadHelper::PATH.to_s) capabilities.add_preference(:browser, set_download_behavior: { behavior: 'allow' }) - Capybara::Selenium::Driver.new(app, browser: :chrome, options: capabilities) + Capybara::Selenium::Driver.new(app, browser: :chrome, capabilities: capabilities) end # Enable JS for Capybara tests diff --git a/spec/requests/storage_locations_requests_spec.rb b/spec/requests/storage_locations_requests_spec.rb index 361c6e0088..7c0500b548 100644 --- a/spec/requests/storage_locations_requests_spec.rb +++ b/spec/requests/storage_locations_requests_spec.rb @@ -143,7 +143,7 @@ expect(response.body).to include("200") end - context "with version date set" do + context "with version date set", versioning: true do context "with a version found" do it "should show the version specified" do travel 1.day do