Class: ViewSiblingRetailerPrice

Inherits:
ApplicationViewRecord show all
Defined in:
app/models/view_sibling_retailer_price.rb

Overview

== Schema Information

Table name: view_sibling_retailer_prices
Database name: primary

catalog_name :string(255)
retail_price :decimal(8, 2)
retail_price_updated_at :datetime
retailer_currency :string(255)
state :string(30)
url :string
catalog_id :integer
catalog_item_id :integer primary key
item_id :integer
store_id :integer

Belongs to collapse

Class Method Summary collapse

Methods inherited from ApplicationViewRecord

create, create!, #readonly?

Methods inherited from ApplicationRecord

ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation

Methods included from Models::EventPublishable

#publish_event

Class Method Details

.excluding_catalogsActiveRecord::Relation<ViewSiblingRetailerPrice>

A relation of ViewSiblingRetailerPrices that are excluding catalogs. Active Record Scope

Returns:

See Also:



26
# File 'app/models/view_sibling_retailer_price.rb', line 26

scope :excluding_catalogs, ->(catalog_ids) { where.not(catalog_id: catalog_ids) }

.for_itemsActiveRecord::Relation<ViewSiblingRetailerPrice>

A relation of ViewSiblingRetailerPrices that are for items. Active Record Scope

Returns:

See Also:



29
# File 'app/models/view_sibling_retailer_price.rb', line 29

scope :for_items, ->(item_ids) { where(item_id: item_ids) }

.for_storeActiveRecord::Relation<ViewSiblingRetailerPrice>

A relation of ViewSiblingRetailerPrices that are for store. Active Record Scope

Returns:

See Also:



32
# File 'app/models/view_sibling_retailer_price.rb', line 32

scope :for_store, ->(store_id) { where(store_id: store_id) }

Instance Method Details

#catalogCatalog

Returns:

See Also:



23
# File 'app/models/view_sibling_retailer_price.rb', line 23

belongs_to :catalog, optional: true

#catalog_itemCatalogItem



22
# File 'app/models/view_sibling_retailer_price.rb', line 22

belongs_to :catalog_item, optional: true