class Commands::Groups::Group::List

Public Instance Methods

execute() click to toggle source
# File lib/restpack_group_service/commands/group/list.rb, line 16
def execute
  scope = Models::Groups::Group.all

  if is_account_group
    scope = scope.where("account_id IS NOT NULL")
  else
    scope = scope.where("account_id IS NULL") unless account_id
  end

  Serializers::Groups::Group.resource(inputs, scope)
end