lib/gaps/db/group.rb
# Updates the properties on this group object. If no groupinfo is
# provided, will automatically retrieve from API.
Updates the properties on this group object. If no groupinfo is
provided, will automatically retrieve from API.
Updates the properties on this group object . If no groupinfo is provided will automatically retrieve from API .
def update_config(groupinfo, user=User.lister)
      if configatron.populate_group_settings
        begin
          settings = user.requestor.get_group_settings(self.group_email)
        rescue Google::APIClient::ServerError => e
          log.error("Error requesting group settings: #{e.message} (#{e.class})", group_email: self.group_email)
        rescue Google::APIClient::ClientError => e
          if e.message =~ /Domain cannot use Api, Groups service is not installed/
            e.message << ' (HINT: you need to be on Google Groups for Business to use the Groups service. You can turn off groups settings population by disabling the `populate_group_settings` key.)'
          end
          raise
        else
          self.group_settings = settings
        end
      end
      groupinfo ||= user.requestor.get_group(self.group_email)
      self.description = groupinfo.fetch('description')
      self.direct_members_count = groupinfo.fetch('directMembersCount')
      _, config = parse_description
      config['category'] ||= self.category || self.group_email.split(/[@-]/)[0]
      self.config = config
      self.deleted = false
    end
def update_config ( groupinfo , user = User . lister ) if configatron . populate_group_settings begin settings = user . requestor . get_group_settings ( self . group_email ) rescue Google :: APIClient :: ServerError => e log . error ( "Error requesting group settings: #{e.message} (#{e.class})" , group_email : self . group_email ) rescue Google :: APIClient :: ClientError => e if e . message =~ / Domain cannot use Api, Groups service is not installed / e . message << ' (HINT: you need to be on Google Groups for Business to use the Groups service. You can turn off groups settings population by disabling the `populate_group_settings` key.)' end raise else self . group_settings = settings end end groupinfo ||= user . requestor . get_group ( self . group_email ) self . description = groupinfo . fetch ( 'description' ) self . direct_members_count = groupinfo . fetch ( 'directMembersCount' ) _ , config = parse_description config [ 'category' ] ||= self . category || self . group_email . split ( / [@-] / ) [ 0 ] self . config = config self . deleted = false end
Updates the properties on this group object.
Updates the properties on this group object .
# This API seems to be flaky sometimes, so swallow error and # continue on. # Be helpful to people # Keep the existing category if one set
groupinfo
<not_specific>
user
<not_specific>
lister
<not_specific>