Title: need to force load of all policies when running in non-server environments · Issue #97 · hyperstack-org/hyperstack · GitHub
Open Graph Title: need to force load of all policies when running in non-server environments · Issue #97 · hyperstack-org/hyperstack
X Title: need to force load of all policies when running in non-server environments · Issue #97 · hyperstack-org/hyperstack
Description: If for example you have a rake task that adds a new record to a model, then at the time the rake task runs all policies may not be loaded, and thus broadcasts resulting from the rake task may not be sent. This does not occur on the serve...
Open Graph Description: If for example you have a rake task that adds a new record to a model, then at the time the rake task runs all policies may not be loaded, and thus broadcasts resulting from the rake task may not b...
X Description: If for example you have a rake task that adds a new record to a model, then at the time the rake task runs all policies may not be loaded, and thus broadcasts resulting from the rake task may not b...
Opengraph URL: https://github.com/hyperstack-org/hyperstack/issues/97
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"need to force load of all policies when running in non-server environments","articleBody":"If for example you have a rake task that adds a new record to a model, then at the time the rake task runs all policies may not be loaded, and thus broadcasts resulting from the rake task may not be sent.\r\n\r\nThis does not occur on the server since the first request from the client needs the value of ActiveRecord::Base.public_columns_hash, and this method forces all models to load, which will force all related policies to load. \r\n\r\nHowever in non-server environments this \"first request\" is never made and hence models not yet loaded will not have policies.\r\n\r\nSolution seems to be to have someplace in HyperModel server side initialization to run `ActiveRecord::Base.public_columns_hash` (instead of waiting for the first request)\r\n\r\nAlternatively it might be nice to tie this to the first after_commit call if the code is NOT running on the server. This would insure the timing is similar for server and non-server environments, but its not clear its necessary.\r\n\r\n\r\nWork Around: \r\n\r\nadding `ActiveRecord::Base.public_columns_hash` at the end of the hyperstack.rb initializer file (outside the configuration block) seems to work fine.","author":{"url":"https://github.com/catmando","@type":"Person","name":"catmando"},"datePublished":"2019-01-02T17:20:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/97/hyperstack/issues/97"}
| 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:5dd61de4-3292-2ac8-243a-50c6608f9aaa |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E654:277BC0:130CA2:18A376:6991D663 |
| html-safe-nonce | c9ec9be604e10fbf260d52f665354775cc84a60a6b556cdc2ca13d708179ee5f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjU0OjI3N0JDMDoxMzBDQTI6MThBMzc2OjY5OTFENjYzIiwidmlzaXRvcl9pZCI6IjUzNjM1NDA5NTMyNjQxNTAxMTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | bb08663027d0822e330941fd540e375dc1d1a6aca24109a684679ef561d86522 |
| hovercard-subject-tag | issue:395319582 |
| 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/97/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b06eb50913c925466e6cdf3f4c01a0b6827cda2dad19b260f527003c2f860c68/hyperstack-org/hyperstack/issues/97 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b06eb50913c925466e6cdf3f4c01a0b6827cda2dad19b260f527003c2f860c68/hyperstack-org/hyperstack/issues/97 |
| og:image:alt | If for example you have a rake task that adds a new record to a model, then at the time the rake task runs all policies may not be loaded, and thus broadcasts resulting from the rake task may not b... |
| 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