Title: ReactiveRecord::Collection#any? breaks cases with args/block passed in · Issue #215 · hyperstack-org/hyperstack · GitHub
Open Graph Title: ReactiveRecord::Collection#any? breaks cases with args/block passed in · Issue #215 · hyperstack-org/hyperstack
X Title: ReactiveRecord::Collection#any? breaks cases with args/block passed in · Issue #215 · hyperstack-org/hyperstack
Description: In the latest release, this method was updated to be smarter and only load the count instead of all the records. But, the case of passing args/block to this method was missed and breaks that functionality. It should now check if args/blo...
Open Graph Description: In the latest release, this method was updated to be smarter and only load the count instead of all the records. But, the case of passing args/block to this method was missed and breaks that functi...
X Description: In the latest release, this method was updated to be smarter and only load the count instead of all the records. But, the case of passing args/block to this method was missed and breaks that functi...
Opengraph URL: https://github.com/hyperstack-org/hyperstack/issues/215
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ReactiveRecord::Collection#any? breaks cases with args/block passed in","articleBody":"In the latest release, this method was updated to be smarter and only load the count instead of all the records. But, the case of passing args/block to this method was missed and breaks that functionality. It should now check if args/block has been passed in, and if so then call super and use normal functionality; otherwise use the optimized way of check if the count is positive:\r\n\r\n```ruby\r\nmodule ReactiveRecord\r\n class Collection\r\n def any?(*args, \u0026block)\r\n # If we are doing anything other than just checking if there is an object in the collection,\r\n # proceed to the normal behavior\r\n return super if args\u0026.length\u0026.positive? || block.present?\r\n\r\n # Otherwise just check the count for efficiency\r\n count.positive?\r\n end\r\n end\r\nend\r\n```","author":{"url":"https://github.com/adamcreekroad","@type":"Person","name":"adamcreekroad"},"datePublished":"2019-07-11T15:18:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/215/hyperstack/issues/215"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:843c5171-0a7d-d317-7cf8-b69dc95e0389 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ED70:D3A00:23CE458:2DA89A5:69919DAE |
| html-safe-nonce | d442e698f68ee31db0a5f68e74d95b6c2724e45118ac752019acc8919405a45f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDcwOkQzQTAwOjIzQ0U0NTg6MkRBODlBNTo2OTkxOURBRSIsInZpc2l0b3JfaWQiOiI3NTg3NDIwMDEzNDg2Nzc1NzI2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a0c10fb785fa2a9530fcf692573187b94e7460c0a98274282de160b981f8a45d |
| hovercard-subject-tag | issue:466956803 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/hyperstack-org/hyperstack/215/issue_layout |
| twitter:image | https://opengraph.githubassets.com/17452255613e98173b2998dfc9829366223afd4e47f357720560bc7fd2df2484/hyperstack-org/hyperstack/issues/215 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/17452255613e98173b2998dfc9829366223afd4e47f357720560bc7fd2df2484/hyperstack-org/hyperstack/issues/215 |
| og:image:alt | In the latest release, this method was updated to be smarter and only load the count instead of all the records. But, the case of passing args/block to this method was missed and breaks that functi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | adamcreekroad |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/hyperstack-org/hyperstack git https://github.com/hyperstack-org/hyperstack.git |
| octolytics-dimension-user_id | 34562730 |
| octolytics-dimension-user_login | hyperstack-org |
| octolytics-dimension-repository_id | 145879576 |
| octolytics-dimension-repository_nwo | hyperstack-org/hyperstack |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 145879576 |
| octolytics-dimension-repository_network_root_nwo | hyperstack-org/hyperstack |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 848bc6032dcc93a9a7301dcc3f379a72ba13b96e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width