1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-28 09:24:24 +01:00
fab-manager/app/services/prepaid_pack_service.rb
2021-06-21 17:39:48 +02:00

15 lines
458 B
Ruby

# frozen_string_literal: true
# Provides methods for PrepaidPack
class PrepaidPackService
def self.list(filters)
packs = PrepaidPack.where(nil)
packs = packs.where(group_id: filters[:group_id]) if filters[:group_id].present?
packs = packs.where(priceable_id: filters[:priceable_id]) if filters[:priceable_id].present?
packs = packs.where(priceable_type: filters[:priceable_type]) if filters[:priceable_type].present?
packs
end
end