Class: Store
Overview
== Schema Information
Table name: stores
Database name: primary
id :integer not null, primary key
base_handling_charge :decimal(8, 2)
contact_email :string(255)
contact_number :string(255)
country_iso3 :string(3)
fax_number :string(255)
jde_branch :string(255)
name :string(255)
order_notification_emails :string default([]), is an Array
owner :string
short_name :string(255)
tax_identification_number_for_shipping :string(255)
warehouse_email :string
company_id :integer
consignee_party_id :integer
customer_for_st_id :integer
mailing_address_id :integer
preferred_inbound_shipping_option_id :integer
preferred_outbound_shipping_option_id :integer
primary_catalog_id :integer
supplier_id :integer
warehouse_address_id :integer
warehouse_service_address_id :integer
Indexes
idx_country_iso3 (country_iso3)
idx_owner (owner)
index_stores_on_company_id (company_id)
index_stores_on_supplier_id (supplier_id)
Foreign Keys
fk_rails_... (consignee_party_id => parties.id)
fk_rails_... (customer_for_st_id => parties.id)
fk_rails_... (supplier_id => parties.id)
Constant Summary
collapse
- WARMLYYOURS_US_ID =
1
- WARMLYYOURS_CA_ID =
2
- PUBLIC_STORE_IDS =
[WARMLYYOURS_US_ID, WARMLYYOURS_CA_ID].freeze
- STORE_TO_LOCALE =
{ 'WarmlyYours-US' => :'en-US', 'WarmlyYours-CA' => :'en-CA' }.freeze
- LOCALE_TO_STORE =
{
en: 'WarmlyYours-US',
'en-US': 'WarmlyYours-US',
'en-CA': 'WarmlyYours-CA',
'fr-CA': 'WarmlyYours-CA'
}.freeze
- LOCALE_TO_STORE_ID =
{
en: 1,
'en-US': 1,
'en-CA': 2,
'fr-CA': 2
}.freeze
- CURRENCY_TO_STORE =
{ 'USD' => 'WarmlyYours-US', 'CAD' => 'WarmlyYours-CA' }.freeze
- CARRIERS_FOR_MASS_SHIP_CONFIRM =
Carriers for mass ship confirm.
{ 'WarmlyYours-US' => %w[FedExGround FedExExpress FedExFreight UPS USPS],
'WarmlyYours-CA' => %w[FedExGround FedExExpress FedExFreight UPS Canadapost Canpar Purolator] }.freeze
- CARRIER_PICKUP_TIMES =
{
'WarmlyYours-US' => { 'FedExGround' => '16:30:00', 'FedExExpress' => '16:00:00', 'FedExFreight' => '17:00:00', 'UPS' => '17:30:00',
'USPS' => '14:00:00' }, 'WarmlyYours-CA' => { 'FedExGround' => '14:00:00', 'FedExFreight' => '17:00:00', 'UPS' => '16:00:00', 'Purolator' => '15:30:00', 'Canadapost' => '15:30:00', 'Canpar' => '14:30:00' }
}.freeze
- CARRIER_PICKUP_CUT_OFF_TIMES =
Carrier pickup cut off times.
{ 'WarmlyYours-US' => { 'FedExFreight' => '12:00:00', 'ShipengineSaia' => '14:00:00', 'USPS' => '14:55:00' },
'WarmlyYours-CA' => { 'FedEx' => '14:00:00', 'FedExFreight' => '12:00:00', 'Canadapost' => '14:55:00',
'Canpar' => '10:55:00' } }.freeze
Models::Auditable::ALWAYS_IGNORED
Constants included
from Schedulable
Schedulable::SIMPLE_FORM_OPTIONS
Instance Attribute Summary collapse
#creator, #updater
Has and belongs to many
collapse
Delegated Instance Attributes
collapse
Class Method Summary
collapse
Instance Method Summary
collapse
#all_skipped_columns, #audit_reference_data, #should_not_save_version, #stamp_record
ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation
config
#after_commit
#publish_event
Instance Attribute Details
#company_id ⇒ Object
120
|
# File 'app/models/store.rb', line 120
validates :company_id, :name, :country_iso3, :warehouse_address, presence: true
|
123
|
# File 'app/models/store.rb', line 123
validates :contact_email, email_format: true
|
125
|
# File 'app/models/store.rb', line 125
validates :contact_number, phone_format: true
|
#country_iso3 ⇒ Object
120
|
# File 'app/models/store.rb', line 120
validates :company_id, :name, :country_iso3, :warehouse_address, presence: true
|
#name ⇒ Object
120
|
# File 'app/models/store.rb', line 120
validates :company_id, :name, :country_iso3, :warehouse_address, presence: true
|
#order_notification_emails ⇒ Object
122
|
# File 'app/models/store.rb', line 122
validates :order_notification_emails, email_format: true
|
#short_name ⇒ Object
121
|
# File 'app/models/store.rb', line 121
validates :name, :short_name, uniqueness: true
|
#warehouse_email ⇒ Object
124
|
# File 'app/models/store.rb', line 124
validates :warehouse_email, email_format: true, allow_blank: true
|
Class Method Details
.by_currency(currency) ⇒ Object
189
190
191
|
# File 'app/models/store.rb', line 189
def self.by_currency(currency)
find_by(name: CURRENCY_TO_STORE[currency])
end
|
.default ⇒ Object
199
200
201
|
# File 'app/models/store.rb', line 199
def self.default
find_by(name: 'WarmlyYours-US')
end
|
.locale_to_catalog(locale = nil) ⇒ Object
183
184
185
186
|
# File 'app/models/store.rb', line 183
def self.locale_to_catalog(locale = nil)
locale ||= I18n.locale
Store.find(store_id_for_locale(locale))
end
|
.options_for_select(filters = nil) ⇒ Object
203
204
205
|
# File 'app/models/store.rb', line 203
def self.options_for_select(filters = nil)
where(filters).order(:name).pluck(:name, :id)
end
|
.potential_owners ⇒ Object
139
140
141
|
# File 'app/models/store.rb', line 139
def self.potential_owners
%w[warmlyyours amazon dimass]
end
|
.store_id_for_locale(locale = nil) ⇒ Object
178
179
180
|
# File 'app/models/store.rb', line 178
def self.store_id_for_locale(locale = nil)
LOCALE_TO_STORE_ID[locale&.to_sym]
end
|
.store_locations_by_id ⇒ Object
257
258
259
|
# File 'app/models/store.rb', line 257
def self.store_locations_by_id
Store.all.to_h { |s| [s.id, s.locations] }
end
|
.warmlyyours_warehouses ⇒ ActiveRecord::Relation<Store>
A relation of Stores that are warmlyyours warehouses. Active Record Scope
135
|
# File 'app/models/store.rb', line 135
scope :warmlyyours_warehouses, -> { where(owner: 'warmlyyours') }
|
Instance Method Details
#alternative_store ⇒ Object
#alternative_stores ⇒ Object
168
169
170
|
# File 'app/models/store.rb', line 168
def alternative_stores
Store.where.not(id:).where(owner: 'warmlyyours')
end
|
#carrier_pickup_for_datetime(carrier_account_id, datetime) ⇒ Object
269
270
271
|
# File 'app/models/store.rb', line 269
def carrier_pickup_for_datetime(carrier_account_id, datetime)
carrier_pickups.for_carrier_account_id(carrier_account_id).for_datetime(datetime).first
end
|
#carrier_pickup_for_today(carrier_account_id) ⇒ Object
265
266
267
|
# File 'app/models/store.rb', line 265
def carrier_pickup_for_today(carrier_account_id)
carrier_pickups.for_carrier_account_id(carrier_account_id).for_today.first
end
|
#carrier_pickup_time(carrier) ⇒ Object
449
450
451
452
453
454
455
|
# File 'app/models/store.rb', line 449
def carrier_pickup_time(carrier)
pu_time = nil
if CARRIER_PICKUP_TIMES[name] && (pu_time_str = CARRIER_PICKUP_TIMES[name][carrier])
pu_time = Time.zone.parse(pu_time_str)
end
pu_time
end
|
#carrier_pickups ⇒ ActiveRecord::Relation<CarrierPickup>
107
|
# File 'app/models/store.rb', line 107
has_many :carrier_pickups, dependent: :destroy
|
#catalogs ⇒ ActiveRecord::Relation<Catalog>
101
|
# File 'app/models/store.rb', line 101
has_many :catalogs, inverse_of: :store
|
88
|
# File 'app/models/store.rb', line 88
belongs_to :company, optional: true
|
#consignee_party ⇒ Customer
89
|
# File 'app/models/store.rb', line 89
belongs_to :consignee_party, class_name: 'Customer', inverse_of: :consignment_stores, optional: true
|
87
|
# File 'app/models/store.rb', line 87
belongs_to :country, foreign_key: :country_iso3, primary_key: :iso3, optional: true
|
#country_code ⇒ Object
207
208
209
|
# File 'app/models/store.rb', line 207
def country_code
country.iso
end
|
#currency ⇒ Object
Alias for Company#currency
197
|
# File 'app/models/store.rb', line 197
delegate :currency, to: :company
|
#currency_symbol ⇒ Object
193
194
195
|
# File 'app/models/store.rb', line 193
def currency_symbol
Money::Currency.new(currency).symbol
end
|
#current_shipping_document_print_profile(employee_record_id = nil) ⇒ Object
225
226
227
|
# File 'app/models/store.rb', line 225
def current_shipping_document_print_profile(employee_record_id = nil)
printer_profile_for_scope(:shipping_document, employee_record_id)
end
|
#current_shipping_label_print_profile(employee_record_id = nil) ⇒ Object
229
230
231
|
# File 'app/models/store.rb', line 229
def current_shipping_label_print_profile(employee_record_id = nil)
printer_profile_for_scope(:shipping_label, employee_record_id)
end
|
#current_upc_label_print_profile(employee_record_id = nil) ⇒ Object
221
222
223
|
# File 'app/models/store.rb', line 221
def current_upc_label_print_profile(employee_record_id = nil)
printer_profile_for_scope(:upc_label, employee_record_id)
end
|
#customer_for_st ⇒ Customer
90
|
# File 'app/models/store.rb', line 90
belongs_to :customer_for_st, class_name: 'Customer', optional: true
|
#cycle_counts ⇒ ActiveRecord::Relation<CycleCount>
105
|
# File 'app/models/store.rb', line 105
has_many :cycle_counts
|
#default_shipping_method ⇒ Object
249
250
251
|
# File 'app/models/store.rb', line 249
def default_shipping_method
{ USA: 'ground', CAN: 'standard' }.dig(country.iso3)
end
|
#email ⇒ Object
241
242
243
244
245
246
247
|
# File 'app/models/store.rb', line 241
def email
if country_iso3 == 'CAN'
'warehousecanada@warmlyyours.com'
else
'warehouseusa@warmlyyours.com'
end
end
|
#email_options_for_order_notification_emails ⇒ Object
164
165
166
|
# File 'app/models/store.rb', line 164
def email_options_for_order_notification_emails
[order_notification_emails].flatten.compact.uniq
end
|
#floor_types ⇒ ActiveRecord::Relation<FloorType>
115
|
# File 'app/models/store.rb', line 115
has_and_belongs_to_many :floor_types
|
#future_carrier_pickups(carrier_account_id) ⇒ Object
273
274
275
|
# File 'app/models/store.rb', line 273
def future_carrier_pickups(carrier_account_id)
carrier_pickups.for_carrier_account_id(carrier_account_id).future_days
end
|
#get_next_sales_rep_assignments_for_customer(customer) ⇒ Object
143
144
145
|
# File 'app/models/store.rb', line 143
def get_next_sales_rep_assignments_for_customer(customer)
sales_rep_queue&.get_next_sales_rep_assignments_for_customer(customer)
end
|
#goods_account ⇒ Object
151
152
153
|
# File 'app/models/store.rb', line 151
def goods_account
warmlyyours_warehouse? ? PURCHASED_FINISHED_GOODS_ACCOUNT : CONSIGNMENT_ACCOUNT
end
|
#heating_element_product_line_options ⇒ ActiveRecord::Relation<HeatingElementProductLineOption>
108
|
# File 'app/models/store.rb', line 108
has_many :heating_element_product_line_options, inverse_of: :store
|
#import_catalog(catalog) ⇒ Object
Import a catalog's store item into this store assuming that will be the only catalog for that store
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
|
# File 'app/models/store.rb', line 278
def import_catalog(catalog)
return if catalog.store_id == id
return if catalog.store.country_iso3 != country_iso3
Catalog.transaction do
if (new_catalog = catalogs.first)
logger.info "Existing catalog: #{new_catalog.name}"
else
new_catalog = catalog.dup
new_catalog.store_id = id
new_catalog.parent_catalog_id = nil
new_catalog.price_sync_policy = :price_sync_manual
new_catalog.price_sync_delay = nil
new_catalog.save!
logger.info "New catalog created: #{new_catalog.id}"
end
catalog.catalog_items.with_item.active.each do |ci|
item_sku = ci.store_item.item.sku
logger.info "Evaluating #{item_sku} from catalog #{catalog.name} for import into store id #{id} - #{name}"
if (new_si = store_items.where(item_id: ci.store_item.item_id).first)
logger.info 'Store item already exists'
else
logger.info 'New store item required'
new_si = ci.store_item.dup
new_si.qty_on_hand = 0
new_si.qty_committed = 0
new_si.unit_cogs = 0
new_si.last_item_ledger_entry_id = nil
new_si.store_id = id
new_si.save!
logger.info "New Store item saved as #{new_si.id}"
end
if (new_ci = new_si.catalog_items.first)
logger.info 'Existing catalog item'
new_ci.attributes = ci.attributes
else
logger.info 'New catalog item'
new_ci = ci.dup
end
new_ci.catalog_id = new_catalog.id
new_ci.store_item_id = new_si.id
new_ci.save!
logger.info "Catalog item #{new_ci.id} saved to catalog id #{new_catalog.id}"
end
end
end
|
#invoices ⇒ ActiveRecord::Relation<Invoice>
113
|
# File 'app/models/store.rb', line 113
has_many :invoices
|
#items ⇒ ActiveRecord::Relation<Item>
100
|
# File 'app/models/store.rb', line 100
has_many :items, through: :store_items
|
#locales_served ⇒ Object
Todo make this more I18n, look at its catalog?
173
174
175
|
# File 'app/models/store.rb', line 173
def locales_served
country.locales_for_country
end
|
#locations ⇒ Object
253
254
255
|
# File 'app/models/store.rb', line 253
def locations
store_items.pluck(:location).uniq
end
|
#mailing_address ⇒ Address
86
|
# File 'app/models/store.rb', line 86
belongs_to :mailing_address, class_name: 'Address', optional: true
|
#manifests ⇒ ActiveRecord::Relation<Manifest>
109
|
# File 'app/models/store.rb', line 109
has_many :manifests, inverse_of: :store
|
#mass_ship_confirm_counter(carrier) ⇒ Object
445
446
447
|
# File 'app/models/store.rb', line 445
def mass_ship_confirm_counter(carrier)
query_mass_ship_confirm_delivery_candidates(carrier).size
end
|
#parties ⇒ ActiveRecord::Relation<Party>
98
|
# File 'app/models/store.rb', line 98
has_many :parties, through: :catalogs
|
#preferred_inbound_shipping_option ⇒ ShippingOption
93
|
# File 'app/models/store.rb', line 93
belongs_to :preferred_inbound_shipping_option, class_name: 'ShippingOption', optional: true
|
#preferred_outbound_shipping_option ⇒ ShippingOption
94
|
# File 'app/models/store.rb', line 94
belongs_to :preferred_outbound_shipping_option, class_name: 'ShippingOption', optional: true
|
#primary_catalog ⇒ Catalog
92
|
# File 'app/models/store.rb', line 92
belongs_to :primary_catalog, class_name: 'Catalog', optional: true
|
#printer_profile_for_scope(scope_name, employee_record_id = nil) ⇒ Object
211
212
213
214
215
216
217
218
219
|
# File 'app/models/store.rb', line 211
def printer_profile_for_scope(scope_name, employee_record_id = nil)
profiles = PrintProfile.in_store_id(id).send(scope_name).order(:id)
profiles = if employee_record_id && profiles.where(employee_record_id:).exists? profiles.where(employee_record_id:)
else profiles.where(employee_record_id: nil)
end
profiles.first
end
|
#printers ⇒ ActiveRecord::Relation<Printer>
111
|
# File 'app/models/store.rb', line 111
has_many :printers
|
#purchase_orders ⇒ ActiveRecord::Relation<PurchaseOrder>
110
|
# File 'app/models/store.rb', line 110
has_many :purchase_orders
|
#query_awaiting_carrier_assignment_orders ⇒ Object
348
349
350
|
# File 'app/models/store.rb', line 348
def query_awaiting_carrier_assignment_orders
Order.by_store_id(id).where(state: 'awaiting_carrier_assignment').with_associations
end
|
#query_mass_ship_confirm_delivery_candidates(carrier) ⇒ Object
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
|
# File 'app/models/store.rb', line 409
def query_mass_ship_confirm_delivery_candidates(carrier)
carrier_to_use = carrier
carrier_to_use = 'FedEx' if %w[FedExGround FedExExpress].include?(carrier)
hw_query = Delivery.by_store_id(id).with_shipment_carrier(carrier_to_use).pending_ship_confirm
hw_query = hw_query.fedex_ground if carrier == 'FedExGround'
hw_query = hw_query.fedex_express if carrier == 'FedExExpress'
amz_query = if carrier == 'FedExExpress'
Delivery.none
else
Delivery.by_store_id(id).with_amz_bs_carrier(carrier_to_use).pending_ship_confirm
end
pickup_time = carrier_pickup_time(carrier)
if pickup_time
hw_query = hw_query.ship_labeled_before(pickup_time)
amz_query = amz_query.ship_labeled_before(pickup_time)
end
Delivery.where(id: hw_query.select(:id))
.or(Delivery.where(id: amz_query.select(:id)))
.distinct.order(:created_at)
end
|
#query_recently_shipped ⇒ Object
392
393
394
395
396
397
398
399
400
401
402
403
|
# File 'app/models/store.rb', line 392
def query_recently_shipped
Delivery.by_store_id(id)
.where(state: %w[shipped invoiced])
.where(Delivery[:shipped_date].gteq(Date.current))
.includes(:uploads,
:destination_address,
:shipping_option,
:freight_events,
line_items: [:item],
order: [:uploads, :creator, { customer: :primary_sales_rep }])
.order(:created_at)
end
|
#query_serial_numbers_pending_print ⇒ Object
388
389
390
|
# File 'app/models/store.rb', line 388
def query_serial_numbers_pending_print
serial_numbers.pending_print.order(:number)
end
|
#query_warehouse_amazon_orders ⇒ Object
374
375
376
377
378
|
# File 'app/models/store.rb', line 374
def query_warehouse_amazon_orders
Order.by_store_id(id).limit_to_fba.where(state: %w[in_cr_hold crm_back_order] + Order::SHIPPING_STATES).joins(:deliveries).order(
Delivery[:future_release_date], Delivery[:created_at]
)
end
|
#query_warehouse_back_orders ⇒ Object
352
353
354
|
# File 'app/models/store.rb', line 352
def query_warehouse_back_orders
Order.by_store_id(id).back_order.with_associations
end
|
#query_warehouse_deliveries(state: nil) ⇒ Object
362
363
364
365
366
367
368
369
370
371
372
|
# File 'app/models/store.rb', line 362
def query_warehouse_deliveries(state: nil)
deliveries = Delivery.by_store_id(id).all_at_warehouse.with_active_parent
.includes(:uploads,
:destination_address,
:shipping_option,
:freight_events,
line_items: [:item],
order: [:uploads, :creator, { customer: :primary_sales_rep }])
deliveries = deliveries.where(state:) if state.present?
deliveries
end
|
#query_warehouse_deliveries_grouped ⇒ Object
380
381
382
|
# File 'app/models/store.rb', line 380
def query_warehouse_deliveries_grouped
query_warehouse_deliveries.group_by(&:state)
end
|
#query_warehouse_deliveries_grouped_counters ⇒ Object
384
385
386
|
# File 'app/models/store.rb', line 384
def query_warehouse_deliveries_grouped_counters
query_warehouse_deliveries.group('deliveries.state').count
end
|
#query_warehouse_held_orders ⇒ Object
344
345
346
|
# File 'app/models/store.rb', line 344
def query_warehouse_held_orders
Order.by_store_id(id).held.with_associations
end
|
#query_warehouse_orders_need_attention ⇒ Object
356
357
358
359
360
|
# File 'app/models/store.rb', line 356
def query_warehouse_orders_need_attention
Order.by_store_id(id).all_awaiting_deliveries.with_associations.joins(:deliveries).where(Delivery[:state].eq('quoting')).order(
Delivery[:future_release_date], Delivery[:created_at]
)
end
|
#query_warehouse_purchase_orders_shipped ⇒ Object
405
406
407
|
# File 'app/models/store.rb', line 405
def query_warehouse_purchase_orders_shipped
purchase_orders.where(state: 'shipped')
end
|
#room_types ⇒ ActiveRecord::Relation<RoomType>
116
|
# File 'app/models/store.rb', line 116
has_and_belongs_to_many :room_types
|
96
|
# File 'app/models/store.rb', line 96
has_one :sales_rep_queue
|
#serial_numbers ⇒ ActiveRecord::Relation<SerialNumber>
106
|
# File 'app/models/store.rb', line 106
has_many :serial_numbers, through: :store_items
|
#services_account ⇒ Object
155
156
157
|
# File 'app/models/store.rb', line 155
def services_account
warmlyyours_warehouse? ? SERVICES_PENDING_FULFILLMENT_DEBIT_ACCOUNT : CONSIGNMENT_ACCOUNT
end
|
#set_carrier_pickup(carrier, carrier_account_id, pickup_resp, pickup_number, scheduled_start, scheduled_end) ⇒ Object
331
332
333
334
335
336
337
338
339
340
341
342
|
# File 'app/models/store.rb', line 331
def set_carrier_pickup(carrier, carrier_account_id, pickup_resp, pickup_number, scheduled_start, scheduled_end)
Rails.logger.debug { "set_carrier_pickup: carrier: #{carrier}" }
Rails.logger.debug { "set_carrier_pickup: carrier_account_id: #{carrier_account_id}" }
Rails.logger.debug { "set_carrier_pickup: pickup_resp: #{pickup_resp.inspect}" }
Rails.logger.debug { "set_carrier_pickup: pickup_number: #{pickup_number}" }
Rails.logger.debug { "set_carrier_pickup: scheduled_start: #{scheduled_start}" }
Rails.logger.debug { "set_carrier_pickup: scheduled_end: #{scheduled_end}" }
pickup = CarrierPickup.new(store_id: id, carrier:, carrier_account_id:, carrier_pickup_id: pickup_number,
scheduled_start:, scheduled_end:)
carrier_pickups << pickup
pickup
end
|
#storage_locations ⇒ ActiveRecord::Relation<StorageLocation>
112
|
# File 'app/models/store.rb', line 112
has_many :storage_locations
|
#store_items ⇒ ActiveRecord::Relation<StoreItem>
99
|
# File 'app/models/store.rb', line 99
has_many :store_items, dependent: :destroy
|
#store_items_with_sku_for_select ⇒ Object
261
262
263
|
# File 'app/models/store.rb', line 261
def store_items_with_sku_for_select
store_items.includes(:item).order('items.sku').pluck('items.sku', :id)
end
|
#store_transfers ⇒ ActiveRecord::Relation<StoreTransfer>
102
|
# File 'app/models/store.rb', line 102
has_many :store_transfers, foreign_key: :from_store_id, primary_key: :id
|
91
|
# File 'app/models/store.rb', line 91
belongs_to :supplier, class_name: 'Supplier'
|
#time_zone_string ⇒ Object
233
234
235
236
237
238
239
|
# File 'app/models/store.rb', line 233
def time_zone_string
if country_iso3 == 'CAN'
'Eastern Time (US & Canada)'
else
'America/Chicago'
end
end
|
#uploads ⇒ ActiveRecord::Relation<Upload>
104
|
# File 'app/models/store.rb', line 104
has_many :uploads, as: :resource, dependent: :destroy
|
#warehouse_address ⇒ Address
Validations:
84
|
# File 'app/models/store.rb', line 84
belongs_to :warehouse_address, class_name: 'Address', optional: true
|
#warehouse_packages ⇒ ActiveRecord::Relation<WarehousePackage>
103
|
# File 'app/models/store.rb', line 103
has_many :warehouse_packages, -> { order(:sort_order, :volume) }, dependent: :destroy
|
#warehouse_service_address ⇒ Address
85
|
# File 'app/models/store.rb', line 85
belongs_to :warehouse_service_address, class_name: 'Address', optional: true
|
#warmlyyours_warehouse? ⇒ Boolean
147
148
149
|
# File 'app/models/store.rb', line 147
def warmlyyours_warehouse?
owner == 'warmlyyours'
end
|