Class: ItemBuilder::Modes::ActiveService
- Inherits:
-
Object
- Object
- ItemBuilder::Modes::ActiveService
show all
- Includes:
- ItemBuilder::Modes
- Defined in:
- lib/item_builder/modes/active_service.rb
Instance Attribute Summary
#bundles, #existing_alloc_stocks, #item_bundle_variants, #listing, #reserved_stocks, #stock_allocs, #variant_listings, #variants, #wh_spaces
Instance Method Summary
collapse
#base, #bundle, #bundle_variants, #existing_allocated_stock, #initialize, #listings, #stock_alloc, #variant, #warehouse
Instance Method Details
#active_variant ⇒ Object
20
21
22
23
24
|
# File 'lib/item_builder/modes/active_service.rb', line 20
def active_variant
VariantListing
.where(local_item_id: listing.local_item_id,
active: 1)
end
|
9
10
11
|
# File 'lib/item_builder/modes/active_service.rb', line 9
def perform
to_h.merge(base)
end
|
#to_h ⇒ Object
13
14
15
16
17
18
|
# File 'lib/item_builder/modes/active_service.rb', line 13
def to_h
{
active: listing.active,
active_variant: active_variant.count
}
end
|