Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Kit Redesign] Phase 1 - Change itemizable source #3750

Draft
wants to merge 62 commits into
base: main
Choose a base branch
from

Conversation

zeeshan-haidar
Copy link
Contributor

@zeeshan-haidar zeeshan-haidar commented Jul 18, 2023

Resolves #3707

Description

Just created the draft PR to get pulse checked to see if I am in the right direction with my approach

Type of change

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Screenshots

…o 3609-kit-allocation-should-create-inventory-in-out
…o 3609-kit-allocation-should-create-inventory-in-out
…o 3609-kit-allocation-should-create-inventory-in-out
…o 3609-kit-allocation-should-create-inventory-in-out
…o 3609-kit-allocation-should-create-inventory-in-out
zeeshan-haidar and others added 28 commits June 23, 2023 16:08
…o 3609-kit-allocation-should-create-inventory-in-out
…o 3609-kit-allocation-should-create-inventory-in-out

# Conflicts:
#	db/schema.rb
…han-haidar/human-essentials into 3609-kit-allocation-should-create-inventory-in-out
…o 3707-change-itemizable-source

# Conflicts:
#	db/migrate/20230606061826_create_kit_allocations.rb
#	db/migrate/20230612075547_add_kit_allocation_type_to_kit_allocations.rb
@zeeshan-haidar zeeshan-haidar marked this pull request as draft July 18, 2023 07:19
Copy link
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good - had some comments. :)

@@ -1,8 +1,8 @@
class KitsController < ApplicationController
def index
@kits = current_organization.kits.includes(line_items: :item, inventory_items: :storage_location).class_filter(filter_params)
@items = Item.where(partner_key: "kit").includes(line_items: :item, inventory_items: :storage_location).class_filter(filter_params)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should use a join here instead of checking partner_key.

@@ -14,6 +14,7 @@
#

class BaseItem < ApplicationRecord
include Itemizable
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, the issue had some bad wording - this has to be added to the Item class, not BaseItem.

@@ -0,0 +1,5 @@
class ChangeItemizableId < ActiveRecord::Migration[7.0]
def change
Rake::Task['change_itemizable_id'].invoke
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this split into a Rake task?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Kit Redesign] Phase 1 - Change itemizable source
2 participants