{"action":"created","issue":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/10247","repository_url":"https://api.github.com/repos/ManageIQ/manageiq","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/10247/labels{/name}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/10247/comments","events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/10247/events","html_url":"https://github.com/ManageIQ/manageiq/pull/10247","id":169283652,"number":10247,"title":"MiqExpression#to_sql: extract/simplify value","user":{"login":"kbrock","id":1930,"avatar_url":"https://avatars.githubusercontent.com/u/1930?v=3","gravatar_id":"","url":"https://api.github.com/users/kbrock","html_url":"https://github.com/kbrock","followers_url":"https://api.github.com/users/kbrock/followers","following_url":"https://api.github.com/users/kbrock/following{/other_user}","gists_url":"https://api.github.com/users/kbrock/gists{/gist_id}","starred_url":"https://api.github.com/users/kbrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbrock/subscriptions","organizations_url":"https://api.github.com/users/kbrock/orgs","repos_url":"https://api.github.com/users/kbrock/repos","events_url":"https://api.github.com/users/kbrock/events{/privacy}","received_events_url":"https://api.github.com/users/kbrock/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/core","name":"core","color":"5319e7"},{"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/refactoring","name":"refactoring","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"gtanzillo","id":76593,"avatar_url":"https://avatars.githubusercontent.com/u/76593?v=3","gravatar_id":"","url":"https://api.github.com/users/gtanzillo","html_url":"https://github.com/gtanzillo","followers_url":"https://api.github.com/users/gtanzillo/followers","following_url":"https://api.github.com/users/gtanzillo/following{/other_user}","gists_url":"https://api.github.com/users/gtanzillo/gists{/gist_id}","starred_url":"https://api.github.com/users/gtanzillo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gtanzillo/subscriptions","organizations_url":"https://api.github.com/users/gtanzillo/orgs","repos_url":"https://api.github.com/users/gtanzillo/repos","events_url":"https://api.github.com/users/gtanzillo/events{/privacy}","received_events_url":"https://api.github.com/users/gtanzillo/received_events","type":"User","site_admin":false},"assignees":[{"login":"gtanzillo","id":76593,"avatar_url":"https://avatars.githubusercontent.com/u/76593?v=3","gravatar_id":"","url":"https://api.github.com/users/gtanzillo","html_url":"https://github.com/gtanzillo","followers_url":"https://api.github.com/users/gtanzillo/followers","following_url":"https://api.github.com/users/gtanzillo/following{/other_user}","gists_url":"https://api.github.com/users/gtanzillo/gists{/gist_id}","starred_url":"https://api.github.com/users/gtanzillo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gtanzillo/subscriptions","organizations_url":"https://api.github.com/users/gtanzillo/orgs","repos_url":"https://api.github.com/users/gtanzillo/repos","events_url":"https://api.github.com/users/gtanzillo/events{/privacy}","received_events_url":"https://api.github.com/users/gtanzillo/received_events","type":"User","site_admin":false}],"milestone":null,"comments":10,"created_at":"2016-08-04T03:32:14Z","updated_at":"2016-08-25T16:25:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/10247","html_url":"https://github.com/ManageIQ/manageiq/pull/10247","diff_url":"https://github.com/ManageIQ/manageiq/pull/10247.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/10247.patch"},"body":"Hypothesis\r\n----------\r\n\r\nWhen `MiqExpression` does not support sql, then `Rbac` does not support sql, then screens pull back all records from the database, and then screens are slow.\r\n\r\nIf `MiqExpression` is small and without duplication, then it is easier to understand and ensure all aspects possible support sql. (And possibly can be supported in ruby without a separate `to_ruby` method.\r\n\r\nScenario\r\n-------\r\n\r\nSeparate field, operator, and value in `to_sql`. This PR focuses on the **value** portion and is split up into a number of commits to show each step of extracting the dates ~~and then date ranges.~~\r\n\r\nI was surprised/pleased by the final range outcome\r\n\r\n/cc @imtayadeway this is what you and I were talking about\r\n\r\n**UPDATE:** I pulled out the range code and just focused on the `normalize` method.\r\nAdded the extra parameter (we will remove soon hopefully) but this really reduced the redundancy.\r\n\r\nInterestingly, I avoided the relative dates, but they ended up disappearing anyway."},"comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments/242451229","html_url":"https://github.com/ManageIQ/manageiq/pull/10247#issuecomment-242451229","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/10247","id":242451229,"user":{"login":"kbrock","id":1930,"avatar_url":"https://avatars.githubusercontent.com/u/1930?v=3","gravatar_id":"","url":"https://api.github.com/users/kbrock","html_url":"https://github.com/kbrock","followers_url":"https://api.github.com/users/kbrock/followers","following_url":"https://api.github.com/users/kbrock/following{/other_user}","gists_url":"https://api.github.com/users/kbrock/gists{/gist_id}","starred_url":"https://api.github.com/users/kbrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbrock/subscriptions","organizations_url":"https://api.github.com/users/kbrock/orgs","repos_url":"https://api.github.com/users/kbrock/repos","events_url":"https://api.github.com/users/kbrock/events{/privacy}","received_events_url":"https://api.github.com/users/kbrock/received_events","type":"User","site_admin":false},"created_at":"2016-08-25T16:25:59Z","updated_at":"2016-08-25T16:25:59Z","body":"@imtayadeway to simplify normalize, I did ponder moving old normalize into `normalize_util`, and have a 6 line `normalize` (with the `utc` / `to_date`) call `normalize_util`.\r\n\r\nit would be less code change. thoughts?"}}
{"actor":{"display_login":"kbrock"}}