-
Notifications
You must be signed in to change notification settings - Fork 898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove old methods for loading virtual columns #11791
Merged
Fryguy
merged 2 commits into
ManageIQ:master
from
lpichler:remove_old_methods_for_loading_virtual_columns
Oct 10, 2016
Merged
Remove old methods for loading virtual columns #11791
Fryguy
merged 2 commits into
ManageIQ:master
from
lpichler:remove_old_methods_for_loading_virtual_columns
Oct 10, 2016
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
we are loading virtual custom columns from MiqExpression when MiqExpression object is created ManageIQ#11369
@lpichler Cannot apply the following label because they are not recognized: technical-debt |
Euwe Backport conflict: $ git cherry-pick -e -x -m 1 5682546
error: could not apply 5682546... Merge pull request #11791 from lpichler/remove_old_methods_for_loading_virtual_columns
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
$ git status
On branch euwe
Your branch is up-to-date with 'upstream/euwe'.
You are currently cherry-picking commit 5682546.
(fix conflicts and run "git cherry-pick --continue")
(use "git cherry-pick --abort" to cancel the cherry-pick operation)
Changes to be committed:
modified: app/models/miq_report.rb
modified: spec/models/miq_report_spec.rb
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: lib/miq_expression.rb
$ git diff diff --cc lib/miq_expression.rb
index ab5ed6e,d74574c..0000000
--- a/lib/miq_expression.rb
+++ b/lib/miq_expression.rb
@@@ -1540,25 -1553,35 +1540,55 @@@ class MiqExpressio
end
end
++<<<<<<< HEAD
+ def custom_attribute_columns(expression = nil)
+ return custom_attribute_columns(exp).uniq if expression.nil?
+
+ case expression
+ when Array
+ expression.flat_map { |x| custom_attribute_columns(x) }
+ when Hash
+ expression_values = expression.values
+
+ if expression.keys.first == "field"
+ field = Field.parse(expression_values.first)
+ field.custom_attribute_column? ? [field.column] : []
+ else
+ expression.keys.first.casecmp('find').zero? ? [] : custom_attribute_columns(expression_values)
++=======
+ def custom_attribute_columns_and_models(expression = nil)
+ return custom_attribute_columns_and_models(exp).uniq if expression.nil?
+
+ case expression
+ when Array
+ expression.flat_map { |x| custom_attribute_columns_and_models(x) }
+ when Hash
+ expression_values = expression.values
+ return [] unless expression.keys.first
+
+ if expression.keys.first == "field"
+ begin
+ field = Field.parse(expression_values.first)
+ rescue StandardError => err
+ _log.error("Cannot parse field #{field}" + err.message)
+ _log.log_backtrace(err)
+ end
+
+ return [] unless field
+
+ field.custom_attribute_column? ? [:model => field.model, :column => field.column] : []
+ else
+ expression.keys.first.casecmp('find').try(:zero?) ? [] : custom_attribute_columns_and_models(expression_values)
++>>>>>>> 5682546... Merge pull request #11791 from lpichler/remove_old_methods_for_loading_virtual_columns
end
else
[]
end
end
++<<<<<<< HEAD
++=======
+
++>>>>>>> 5682546... Merge pull request #11791 from lpichler/remove_old_methods_for_loading_virtual_columns
private |
@lpichler Please make an Euwe-specific PR resolving the cherry-pick conflict above or specify another PR that needs to be backported. |
chessbyte
pushed a commit
that referenced
this pull request
Oct 14, 2016
…g_virtual_columns Remove old methods for loading virtual columns (cherry picked from commit 5682546)
Since #11369 has been backported to Euwe, this now cherry-picks cleanly. $ git log -1
commit e72dd31de033b77a6cc51c8537766f8656306f3a
Author: Jason Frey <fryguy9@gmail.com>
Date: Mon Oct 10 18:23:55 2016 -0400
Merge pull request #11791 from lpichler/remove_old_methods_for_loading_virtual_columns
Remove old methods for loading virtual columns
(cherry picked from commit 5682546c8658d1d084e8b576be16faa9fe4871ac) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
we are loading virtual custom columns from MiqExpression
when MiqExpression object is created #11369
so don't need to load it in when report is generated.
@miq-bot add_label reporting, technical-debt