Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/tableau_server_client/resources/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def hierarchy
end

def workbooks
@client.get_collection(Workbook.location(site_path, filter: [])).select {|w|
@client.get_collection(Workbook.location(site_path, filter: ["projectName:eq:#{name}"])).select {|w|
w.project_id == id
}
end
Expand Down
4 changes: 2 additions & 2 deletions lib/tableau_server_client/resources/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ def full_name

def workbooks
@client.get_collection(Workbook.location(site_path, filter: ["ownerName:eq:#{full_name}"])).select do |w|
w.owner.id == id
w.owner_id == id
end
end

def datasources
@client.get_collection(Datasource.location(site_path, filter: ["ownerName:eq:#{full_name}"])).select do |d|
d.owner.id == id
d.owner_id == id
end
end

Expand Down
4 changes: 3 additions & 1 deletion lib/tableau_server_client/resources/view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ class View < Resource

def self.from_response(client, path, xml)
attrs = extract_attributes(xml)
attrs['workbook_id'] = xml.xpath("xmlns:workbook")[0]['id']
# The workbook-scoped views endpoint (/workbooks/<id>/views) omits the
# <workbook> element since it is already implied, so guard against nil.
attrs['workbook_id'] = xml.xpath("xmlns:workbook")[0]&.fetch('id', nil)
new(client, path, attrs)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/tableau_server_client/resources/workbook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def owner
end

def views
@views ||= @client.get_collection(View.location(site_path)).select {|v| v.workbook_id == id }
@views ||= @client.get_collection(View.location(path))
end

def to_request
Expand Down