diff --git a/app/models/organization.rb b/app/models/organization.rb index b59a2a420d..53614a7628 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -197,7 +197,7 @@ def total_inventory end def self.seed_items(organization = Organization.all) - base_items = BaseItem.all.map(&:to_h) + base_items = BaseItem.without_kit.map(&:to_h) Array.wrap(organization).each do |org| Rails.logger.info "\n\nSeeding #{org.name}'s items...\n" diff --git a/spec/models/organization_spec.rb b/spec/models/organization_spec.rb index 4838d82120..6c8037ccda 100644 --- a/spec/models/organization_spec.rb +++ b/spec/models/organization_spec.rb @@ -238,6 +238,14 @@ expect(organization.items.count).to eq(1) end + + it "should exclude kit" do + create(:base_item, name: "Kit", partner_key: "foo") + + Organization.seed_items(organization) + + expect(organization.items.count).to eq(0) + end end context "when no organization is provided" do