class Group

Schema Information

Table name: groups

id            :integer          not null, primary key
name          :string(255)
description   :text
company_id    :integer
resource_id   :integer
resource_type :string(255)

Public Instance Methods

automated_group?() click to toggle source

Returns true if resource type is not user

# File app/models/group.rb, line 52
def automated_group?
  !user_group?
end
fixxpertable?() click to toggle source

Returns true if resource type is subtrade

# File app/models/group.rb, line 66
def fixxpertable?
  resource_type == 'Subtrade'
end
fixxperts() click to toggle source

Returns fixxperts

Calls superclass method
# File app/models/group.rb, line 57
def fixxperts
  if fixxpertable?
    resource.fixxperts
  else
    super
  end
end
trigger_pusher_group_event() click to toggle source

Trigger background job to create/update groups

# File app/models/group.rb, line 71
def trigger_pusher_group_event
  CreateOrUpdateGroups.perform_async(id)
end
user_group?() click to toggle source

Returns true if resource type is user

# File app/models/group.rb, line 47
def user_group?
  resource_type == 'User'
end
user_ids=(ids) click to toggle source

Convert comma separated user ids string into array format.

Calls superclass method
# File app/models/group.rb, line 41
def user_ids=(ids)
  ids = ids.split(',') if ids.is_a? String
  super(ids)
end