Class: DataStore::Category

Inherits:
Object
  • Object
show all
Includes:
DataMapper::Resource
Defined in:
lib/flexquery_datastore/models/Category.rb

Instance Method Summary collapse

Instance Method Details

#productsObject



16
17
18
19
20
21
# File 'lib/flexquery_datastore/models/Category.rb', line 16

def products
  product_ids = repository.adapter
    .select('SELECT desc1 FROM rp8inventoryitems WHERE dcs = ?', self.dcs)
    .uniq
  DataStore::Product.all(desc1: product_ids, unique: true)
end

#variantsObject



23
24
25
# File 'lib/flexquery_datastore/models/Category.rb', line 23

def variants
  DataStore::Variant.all(dcs: self.dcs)
end