Files
old-ribica/front-api/models/item_group.rb

11 lines
250 B
Ruby

class ItemGroup < ActiveRecord::Base
has_many :item_in_groups
has_many :items, through: :item_in_groups
def all_items(offset, limit)
self.items.where(on_display: true).order("item_in_groups.position").limit(limit).offset(offset).all
end
end