A method that shows maps users are a part of
This would potentially be a very expensive way to do this as you have to query the dtabase once for every group the user is in, i.e. an n+1 query. You should be able to do it with a single query by creating a relation:

class User &lt; ApplicationRecord
  belongs_to :usergroup
  has_many   :groups,     through: :usergroup
  has_many   :maps,       through: :groups


then you can just query the map relation.  An alternative would be to use a join. There is more than one way to do this but you could do:

def fetch_maps
  Map.joins(:mapgroups =&gt; {:groups =&gt; :users} ).where(user: self)
end


Rails doesn't always run the queries the way you expect so I suggest you run your code in the console or watch your log files to make sure that you are only running one query.