Class: Maestrano::Api::OrganizationResource

Inherits:
BaseResource
  • Object
show all
Defined in:
app/resources/maestrano/api/organization_resource.rb

Constant Summary

Constants inherited from BaseResource

BaseResource::API_SQL_OPERATOR_MAPPING

Instance Method Summary collapse

Methods inherited from BaseResource

all_filters, attribute_type, generate_composite_filters, tables_exists?

Instance Method Details



29
30
31
# File 'app/resources/maestrano/api/organization_resource.rb', line 29

def 
  Maestrano::Connector::Rails::External.(@model || nil)
end

#account_linked?Boolean Also known as: has_account_linked

Returns:

  • (Boolean)


23
24
25
# File 'app/resources/maestrano/api/organization_resource.rb', line 23

def 
  @model.oauth_uid.present?
end

#entities_typesObject



38
39
40
# File 'app/resources/maestrano/api/organization_resource.rb', line 38

def entities_types
  ['All', *Maestrano::Connector::Rails::IdMap.uniq.pluck(:external_entity)]
end

#saveObject



33
34
35
36
# File 'app/resources/maestrano/api/organization_resource.rb', line 33

def save
  @model.tenant = context[:client]
  super
end