Title: client scope optimization doesn't work if `all` scope is dummy or unknown · Issue #78 · hyperstack-org/hyperstack · GitHub
Open Graph Title: client scope optimization doesn't work if `all` scope is dummy or unknown · Issue #78 · hyperstack-org/hyperstack
X Title: client scope optimization doesn't work if `all` scope is dummy or unknown · Issue #78 · hyperstack-org/hyperstack
Description: try the todo example, with prerendering off and then in Todo model: class Todo < ApplicationRecord scope :completed, -> () { where(completed: true) }, client: -> { completed } scope :active, -> () { where(completed: false) }, client: -> ...
Open Graph Description: try the todo example, with prerendering off and then in Todo model: class Todo < ApplicationRecord scope :completed, -> () { where(completed: true) }, client: -> { completed } scope :active, -> () ...
X Description: try the todo example, with prerendering off and then in Todo model: class Todo < ApplicationRecord scope :completed, -> () { where(completed: true) }, client: -> { completed } scope :activ...
Opengraph URL: https://github.com/hyperstack-org/hyperstack/issues/78
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"client scope optimization doesn't work if `all` scope is dummy or unknown","articleBody":"try the todo example, with prerendering off and then in Todo model:\r\n\r\n```ruby\r\nclass Todo \u003c ApplicationRecord\r\n scope :completed, -\u003e () { where(completed: true) }, client: -\u003e { completed }\r\n scope :active, -\u003e () { where(completed: false) }, client: -\u003e { !completed }\r\nend\r\n```\r\n\r\n\r\nLoad the all scope, notice that the active todo count sticks at one,\r\nthen when we look at the active scope, it only contains one (wrong usually) item.\r\n\r\nProblem is occuring because on the footer we do a count of the active scope. Presumably this causes the completed client side scoping rule to be run, but on the dummy 'all' scope.\r\n\r\nIf you remove the footer the problem goes away.\r\n\r\n\r\n","author":{"url":"https://github.com/catmando","@type":"Person","name":"catmando"},"datePublished":"2018-12-06T23:34:02.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/78/hyperstack/issues/78"}
| 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:c27663f8-26c9-249d-9d33-961d70fdd7b3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AD38:C4D11:140542E:19A361D:69919D58 |
| html-safe-nonce | a0b8a6c372950189345359ea1eb7a91b3620a6bf57d7849d8ed25e967d288f48 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRDM4OkM0RDExOjE0MDU0MkU6MTlBMzYxRDo2OTkxOUQ1OCIsInZpc2l0b3JfaWQiOiIyMTA1OTExMTMyMzA0ODA5MzA0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5d6979251a6d93447d8e8a58ab4e6c546feb19d2ec88c495a3067c69fcf4570b |
| hovercard-subject-tag | issue:388443221 |
| 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/78/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8911855296651b4ea74977c70a82ed72b0049791333ae3e2d4795314b8568d3f/hyperstack-org/hyperstack/issues/78 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8911855296651b4ea74977c70a82ed72b0049791333ae3e2d4795314b8568d3f/hyperstack-org/hyperstack/issues/78 |
| og:image:alt | try the todo example, with prerendering off and then in Todo model: class Todo < ApplicationRecord scope :completed, -> () { where(completed: true) }, client: -> { completed } scope :active, -> () ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | catmando |
| 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