Skip to content

Commit

Permalink
Merge pull request #13675 from kbrock/report_both_includes_super
Browse files Browse the repository at this point in the history
Reports: remove need to declare includes
  • Loading branch information
martinpovolny committed Feb 8, 2017
2 parents ff425fd + 3af1aeb commit 9bdd3cd
Show file tree
Hide file tree
Showing 44 changed files with 10 additions and 459 deletions.
11 changes: 10 additions & 1 deletion app/models/miq_report/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,16 @@ def table2class(table)
end

def get_include_for_find
(include_as_hash || {}).deep_merge(include_for_find || {}).presence
(include_as_hash.presence || invent_includes).deep_merge(include_for_find || {}).presence
end

def invent_includes
return {} unless col_order
col_order.each_with_object({}) do |col, ret|
next unless col.include?(".")
*rels, _col = col.split(".")
rels.inject(ret) { |h, rel| h[rel.to_sym] ||= {} } unless col =~ /managed\./
end
end

def include_as_hash(includes = include, klass = nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,6 @@ cols:
- bytes
- object_count

# Included tables (joined, has_one, has_many) and columns
include:
cloud_tenant:
columns:
- name
ext_management_system:
columns:
- name


# Included tables and columns for query performance
# include_for_find:

# Order of columns (from all tables)
col_order:
- key
Expand Down
13 changes: 0 additions & 13 deletions product/views/CloudObjectStoreContainer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,6 @@ cols:
- bytes
- object_count

# Included tables (joined, has_one, has_many) and columns
include:
cloud_tenant:
columns:
- name
ext_management_system:
columns:
- name


# Included tables and columns for query performance
# include_for_find:

# Order of columns (from all tables)
col_order:
- key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,6 @@ cols:
- last_modified
- etag

# Included tables (joined, has_one, has_many) and columns
include:
cloud_object_store_container:
columns:
- key
cloud_tenant:
columns:
- name
ext_management_system:
columns:
- name

# Included tables and columns for query performance
# include_for_find:

# Order of columns (from all tables)
col_order:
- key
Expand Down
15 changes: 0 additions & 15 deletions product/views/CloudObjectStoreObject.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,6 @@ cols:
- last_modified
- etag

# Included tables (joined, has_one, has_many) and columns
include:
cloud_object_store_container:
columns:
- key
cloud_tenant:
columns:
- name
ext_management_system:
columns:
- name

# Included tables and columns for query performance
# include_for_find:

# Order of columns (from all tables)
col_order:
- key
Expand Down
9 changes: 0 additions & 9 deletions product/views/CloudSubnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@ cols:
- dns_nameservers_show
- total_vms

# Included tables (joined, has_one, has_many) and columns
include:
ext_management_system:
columns:
- name

# Included tables and columns for query performance
include_for_find:

# Order of columns (from all tables)
col_order:
- name
Expand Down
9 changes: 0 additions & 9 deletions product/views/CloudTenant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@ cols:
- name
- total_vms

# Included tables (joined, has_one, has_many) and columns
include:
ext_management_system:
columns:
- name

# Included tables and columns for query performance
include_for_find:

# Order of columns (from all tables)
col_order:
- name
Expand Down
13 changes: 0 additions & 13 deletions product/views/CloudVolume-based_volumes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,6 @@ cols:
- volume_type
- bootable

# Included tables (joined, has_one, has_many) and columns
include:
availability_zone:
columns:
- name
ext_management_system:
columns:
- name


# Included tables and columns for query performance
# include_for_find:

# Order of columns (from all tables)
col_order:
- name
Expand Down
12 changes: 0 additions & 12 deletions product/views/CloudVolume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,6 @@ cols:
- volume_type
- bootable

# Included tables (joined, has_one, has_many) and columns
include:
availability_zone:
columns:
- name
ext_management_system:
columns:
- name

# Included tables and columns for query performance
# include_for_find:

# Order of columns (from all tables)
col_order:
- name
Expand Down
13 changes: 0 additions & 13 deletions product/views/CloudVolumeBackup-cloud_volume_backups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,6 @@ cols:
- size
- status

# Included tables (joined, has_one, has_many) and columns
include:
cloud_volume:
columns:
- name
ext_management_system:
columns:
- name


# Included tables and columns for query performance
# include_for_find:

# Order of columns (from all tables)
col_order:
- name
Expand Down
10 changes: 0 additions & 10 deletions product/views/CloudVolumeBackup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ cols:
- size
- status

# Included tables (joined, has_one, has_many) and columns
include:
cloud_volume:
columns:
- name
ext_management_system:
columns:
- name


# Included tables and columns for query performance
# include_for_find:

Expand Down
10 changes: 0 additions & 10 deletions product/views/CloudVolumeSnapshot-cloud_volume_snapshots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@ cols:
- status
- total_based_volumes

# Included tables (joined, has_one, has_many) and columns
include:
cloud_volume:
columns:
- name
ext_management_system:
columns:
- name


# Included tables and columns for query performance
# include_for_find:

Expand Down
10 changes: 0 additions & 10 deletions product/views/CloudVolumeSnapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@ cols:
- status
- total_based_volumes

# Included tables (joined, has_one, has_many) and columns
include:
cloud_volume:
columns:
- name
ext_management_system:
columns:
- name


# Included tables and columns for query performance
# include_for_find:

Expand Down
12 changes: 0 additions & 12 deletions product/views/Container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,6 @@ cols:
- name
- state

# Included tables (joined, has_one, has_many) and columns
include:
container_group:
columns:
- name
container_image:
columns:
- name

# Included tables and columns for query performance
include_for_find:

# Order of columns (from all tables)
col_order:
- name
Expand Down
13 changes: 0 additions & 13 deletions product/views/ContainerBuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,6 @@ cols:
- output_name
- completion_deadline_seconds

# Included tables (joined, has_one, has_many) and columns
include:
container_project:
columns:
- name
ext_management_system:
columns:
- name


# Included tables and columns for query performance
include_for_find:

# Order of columns (from all tables)
col_order:
- name
Expand Down
12 changes: 0 additions & 12 deletions product/views/ContainerGroup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,6 @@ cols:
- dns_policy
- running_containers_summary

# Included tables (joined, has_one, has_many) and columns
include:
container_project:
columns:
- name
ext_management_system:
columns:
- name

# Included tables and columns for query performance
include_for_find:

# Order of columns (from all tables)
col_order:
- name
Expand Down
9 changes: 0 additions & 9 deletions product/views/ContainerImage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,6 @@ cols:
- image_ref
- display_registry

# Included tables (joined, has_one, has_many) and columns
include:
ext_management_system:
columns:
- name

# Included tables and columns for query performance
include_for_find:

# Order of columns (from all tables)
col_order:
- name
Expand Down
8 changes: 0 additions & 8 deletions product/views/ContainerImageRegistry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ cols:
- host
- port

# Included tables (joined, has_one, has_many) and columns
include:
ext_management_system:
columns:
- name
# Included tables and columns for query performance
include_for_find:

# Order of columns (from all tables)
col_order:
- host
Expand Down
9 changes: 0 additions & 9 deletions product/views/ContainerNode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ cols:
- kernel_version
- container_runtime_version

# Included tables (joined, has_one, has_many) and columns
include:
ext_management_system:
columns:
- name

# Included tables and columns for query performance
include_for_find:

# Order of columns (from all tables)
col_order:
- name
Expand Down
9 changes: 0 additions & 9 deletions product/views/ContainerProject.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@ cols:
- containers_count
- images_count

# Included tables (joined, has_one, has_many) and columns
include:
ext_management_system:
columns:
- name

# Included tables and columns for query performance
include_for_find:

# Order of columns (from all tables)
col_order:
- name
Expand Down
12 changes: 0 additions & 12 deletions product/views/ContainerReplicator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,6 @@ cols:
- replicas
- current_replicas

# Included tables (joined, has_one, has_many) and columns
include:
container_project:
columns:
- name
ext_management_system:
columns:
- name

# Included tables and columns for query performance
include_for_find:

# Order of columns (from all tables)
col_order:
- name
Expand Down
Loading

0 comments on commit 9bdd3cd

Please sign in to comment.