Skip to content
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

ActsAsArModel supports more report and rbac use cases #10268

Merged
merged 1 commit into from
Aug 17, 2016

Conversation

kbrock
Copy link
Member

@kbrock kbrock commented Aug 4, 2016

BLOCKED ON: #10273

Screens that display ActsAsArModel are broken. There are a few steps to merge:

Fixes #10087

Details:

  1. Support includes(:table => {}) (an similar references / order). It is not smart enought to properly the second level of hashes. but :includes is not really supported by our ActsAsArModel implementations.
  2. Support references(:table => {}). Though we do not use :references in any of our implementations, it was blowing up before. it was free with the includes() implementation
  3. Support order(Hash). It was free. We may need to support other syntaxes for this as well.
  4. Support length attribute, which is essentially the same as size
  5. Support where(nil) which is getting called more often now that we are sql munging less.

/cc @lucasponce

@@ -451,6 +448,11 @@ def method_with_scope(ar_scope, options)
end

def apply_scope(klass, scope)
klass = to_class(klass)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ends up calling to_class twice (once on line 177) and then again here. Is that expected?

Copy link
Member Author

@kbrock kbrock Aug 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to_class takes a string and calls constantize on it. If a class is passed in, it is a no-op.

I want just this call, but wasn't able to delete line 177 yet.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove this call to make more clear

@kbrock kbrock changed the title ActsAsArModel supports more report and rbac use cases [BLOCKED] ActsAsArModel supports more report and rbac use cases Aug 4, 2016
@kbrock
Copy link
Member Author

kbrock commented Aug 4, 2016

@Fryguy changed the naming a bit. added some comments and added a test class here too to show what is happening.

I tried to update the changes your suggested.

If you note, the blocked PRs are at the beginning of the commit list, but this PR is only 1 commit. and should be pretty close to the original PR that you reviewed.

@kbrock kbrock added bug and removed enhancement labels Aug 5, 2016
@kbrock kbrock force-pushed the aaar_rbac_check branch 2 times, most recently from eb60297 to dfe96fc Compare August 6, 2016 01:19
@kbrock
Copy link
Member Author

kbrock commented Aug 6, 2016

rebased with fixes to other PR. (you can see green dots in commit lists

@kbrock kbrock changed the title [BLOCKED] ActsAsArModel supports more report and rbac use cases ActsAsArModel supports more report and rbac use cases Aug 10, 2016
@kbrock kbrock force-pushed the aaar_rbac_check branch 2 times, most recently from 2090b1c to 802e501 Compare August 10, 2016 12:52
ensure all is called so the aaar query object is used
@miq-bot
Copy link
Member

miq-bot commented Aug 10, 2016

Checked commit kbrock@7d8baed with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1
2 files checked, 0 offenses detected
Everything looks good. 🍪

@kbrock
Copy link
Member Author

kbrock commented Aug 10, 2016

@Fryguy unblocked. not sure if you have any further comments

@lucasponce
Copy link
Contributor

Hi, is there any ETA when all the PRs related to ActsAsArModel changes will be merged ?
After they are in we should validate if we need to perform additional changes on the provider side.
Any info would be welcome :).
/cc @kbrock @abonas

@gtanzillo gtanzillo added this to the Sprint 45 Ending Aug 22, 2016 milestone Aug 17, 2016
@gtanzillo gtanzillo merged commit b17b3a4 into ManageIQ:master Aug 17, 2016
@kbrock kbrock deleted the aaar_rbac_check branch August 18, 2016 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants