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

9 lines
233 B
Ruby

class ItemGroup < ActiveRecord::Base
has_and_belongs_to_many :items, :join_table => 'item_item_groups'
def all_items(offset, limit)
self.items.where(on_display: true).order(:created_at).limit(limit).offset(offset).all
end
end