lib/gooddata/models/profile.rb in gooddata-0.6.16 vs lib/gooddata/models/profile.rb in gooddata-0.6.17
- old
+ new
@@ -57,11 +57,11 @@
if id.to_s !~ %r{^(\/gdc\/account\/profile\/)?[a-zA-Z\d]+$}
fail(ArgumentError, 'wrong type of argument. Should be either project ID or path')
end
- id = id.match(/[a-zA-Z\d]+$/)[0] if id =~ /\//
+ id = id.match(/[a-zA-Z\d]+$/)[0] if id =~ %r{/}
c = client(opts)
fail ArgumentError, 'No :client specified' if c.nil?
response = c.get(PROFILE_PATH % id)
@@ -370,17 +370,27 @@
def name
(first_name || '') + (last_name || '')
end
+ def sso_provider
+ @json['accountSetting']['ssoProvider']
+ end
+
+ def sso_provider=(an_sso_provider)
+ @dirty = true
+ @json['accountSetting']['ssoProvider'] = an_sso_provider
+ end
+
def to_hash
tmp = content.merge(uri: uri).symbolize_keys
[
[:companyName, :company],
[:phoneNumber, :phone],
[:firstName, :first_name],
[:lastName, :last_name],
- [:authenticationModes, :authentication_modes]
+ [:authenticationModes, :authentication_modes],
+ [:ssoProvider, :sso_provider]
].each do |vals|
wire, rb = vals
tmp[rb] = tmp[wire]
tmp.delete(wire)
end