mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-15 00:24:09 +01:00
16 lines
317 B
Ruby
16 lines
317 B
Ruby
# frozen_string_literal: true
|
|
|
|
# Provides methods for Groups
|
|
class GroupService
|
|
def self.list(filters = {})
|
|
groups = Group.where(nil)
|
|
|
|
if filters[:disabled].present?
|
|
state = filters[:disabled] == 'false' ? [nil, false] : true
|
|
groups = groups.where(disabled: state)
|
|
end
|
|
|
|
groups
|
|
end
|
|
end
|