groups of articles now shown on ribica.ba/group/1/, background is in cloudinary
This commit is contained in:
8
front-api/models/item_group.rb
Normal file
8
front-api/models/item_group.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
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
|
||||
Reference in New Issue
Block a user