Sha256: 92d33fb170b0a39c0b5b4268fe5cd1d596704117483e374b8b4601cf7a3962d7
Contents?: true
Size: 667 Bytes
Versions: 47
Compression:
Stored size: 667 Bytes
Contents
require_dependency "hubstats/application_controller" module Hubstats class BaseController < Hubstats::ApplicationController # Public - If the group is being asked to be grouped by user or repo, will make an array and group the data # by either username or repo name. # # group_request - string of what the data should be grouped by # group - the group of data to be grouped # # Returns - nothing def grouping (group_request, group) if group_request == "user" @groups = group.to_a.group_by(&:user_name) elsif group_request == "repo" @groups = group.to_a.group_by(&:repo_name) end end end end
Version data entries
47 entries across 47 versions & 1 rubygems