Class: OMF::SFA::Resource::User

Inherits:
OResource show all
Defined in:
lib/omf-sfa/resource/user.rb

Overview

This class represents a user in the system.

Instance Method Summary collapse

Methods inherited from OResource

#_dirty_self?, #_oprops_to_hash, #all_resources, #clone, #default_href_prefix, #destroy, #destroy!, #dirty_self?, #each_resource, #group?, #href, href_resolver, init, json_create, #oproperties_as_hash, #oproperty, oproperty, #oproperty_array_get, #oproperty_get, #oproperty_set, prop_all, #remove_from_all_groups, #resource_type, #status, #to_hash, #to_hash_brief, #to_json, #uuid

Instance Method Details

#to_hash_long(h, objs, opts = {}) ⇒ Object

has n, :project_memberships has n, :projects, :through => :project_memberships, :via => :project



15
16
17
18
19
20
21
22
# File 'lib/omf-sfa/resource/user.rb', line 15

def to_hash_long(h, objs, opts = {})
  super
  href_only = opts[:level] >= opts[:max_level]
  h[:projects] = self.projects.map do |p|
    href_only ? p.href : p.to_hash(objs, opts)
  end
  h
end