Title: Error "undefined method 'where' for" error on ActiveModel based resource · Issue #1467 · JSONAPI-Resources/jsonapi-resources · GitHub
Open Graph Title: Error "undefined method 'where' for" error on ActiveModel based resource · Issue #1467 · JSONAPI-Resources/jsonapi-resources
X Title: Error "undefined method 'where' for" error on ActiveModel based resource · Issue #1467 · JSONAPI-Resources/jsonapi-resources
Description: We just tried moving from v0.9.12 to v0.10.7 (and even tried with lower 10.x versions) and now our ActiveModel based models no longer work via resources. We now get a Internal Server Error: undefined method 'where' for error. Not sure wh...
Open Graph Description: We just tried moving from v0.9.12 to v0.10.7 (and even tried with lower 10.x versions) and now our ActiveModel based models no longer work via resources. We now get a Internal Server Error: undefin...
X Description: We just tried moving from v0.9.12 to v0.10.7 (and even tried with lower 10.x versions) and now our ActiveModel based models no longer work via resources. We now get a Internal Server Error: undefin...
Opengraph URL: https://github.com/JSONAPI-Resources/jsonapi-resources/issues/1467
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Error \"undefined method 'where' for\" error on ActiveModel based resource","articleBody":"We just tried moving from v0.9.12 to v0.10.7 (and even tried with lower 10.x versions) and now our ActiveModel based models no longer work via resources. We now get a `Internal Server Error: undefined method 'where' for` error. Not sure what to do. Any help is greatly appreciated.\n\n```\n2025-02-24 20:22:55.712035 E [16:puma srv tp 004 acts_as_resource_controller.rb:289] {uuid: 0f40c8d0c138f0444cf4be9f7a8ec7ae} Rails -- Internal Server Error: undefined method `where' for AuthorizeV2:Class /app/vendor/bundle/ruby/3.2.0/gems/jsonapi-resources-0.10.7/lib/jsonapi/active_relation_resource.rb:877:in `apply_filter'\n/app/vendor/bundle/ruby/3.2.0/gems/jsonapi-resources-0.10.7/lib/jsonapi/active_relation_resource.rb:846:in `block in apply_filters'\n/app/vendor/bundle/ruby/3.2.0/gems/jsonapi-resources-0.10.7/lib/jsonapi/active_relation_resource.rb:845:in `each'\n/app/vendor/bundle/ruby/3.2.0/gems/jsonapi-resources-0.10.7/lib/jsonapi/active_relation_resource.rb:845:in `apply_filters'\n/app/vendor/bundle/ruby/3.2.0/gems/jsonapi-resources-0.10.7/lib/jsonapi/active_relation_resource.rb:777:in `filter_records'\n/app/vendor/bundle/ruby/3.2.0/gems/jsonapi-resources-0.10.7/lib/jsonapi/active_relation_resource.rb:707:in `apply_request_settings_to_records'\n/app/vendor/bundle/ruby/3.2.0/gems/jsonapi-resources-0.10.7/lib/jsonapi/active_relation_resource.rb:107:in `find_fragments'\n/app/vendor/bundle/ruby/3.2.0/gems/jsonapi-resources-0.10.7/lib/jsonapi/processor.rb:412:in `find_resource_id_tree'\n/app/vendor/bundle/ruby/3.2.0/gems/jsonapi-resources-0.10.7/lib/jsonapi/processor.rb:372:in `find_resource_set'\n/app/vendor/bundle/ruby/3.2.0/gems/jsonapi-resources-0.10.7/lib/jsonapi/processor.rb:245:in `create_resource'\n/app/vendor/bundle/ruby/3.2.0/gems/jsonapi-resources-0.10.7/lib/jsonapi/processor.rb:34:in `block (2 levels) in process'\n/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8.7/lib/active_support/callbacks.rb:107:in `run_callbacks'\n/app/vendor/bundle/ruby/3.2.0/gems/jsonapi-resources-0.10.7/lib/jsonapi/processor.rb:33:in `block in process'\n/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8.7/lib/active_support/callbacks.rb:99:in `run_callbacks'\n/app/vendor/bundle/ruby/3.2.0/gems/jsonapi-resources-0.10.7/lib/jsonapi/processor.rb:32:in `process'\n/app/vendor/bundle/ruby/3.2.0/gems/jsonapi-resources-0.10.7/lib/jsonapi/operation.rb:12:in `process'\n/app/vendor/bundle/ruby/3.2.0/gems/jsonapi-resources-0.10.7/lib/jsonapi/acts_as_resource_controller.rb:140:in `process_operation'\n/app/vendor/bundle/ruby/3.2.0/gems/jsonapi-resources-0.10.7/lib/jsonapi/acts_as_resource_controller.rb:110:in `block (3 levels) in process_request'\n/app/vendor/bundle/ruby/3.2.0/gems/jsonapi-resources-0.10.7/lib/jsonapi/request_parser.rb:32:in `each'\n/app/vendor/bundle/ruby/3.2.0/gems/jsonapi-resources-0.10.7/lib/jsonapi/acts_as_resource_controller.rb:97:in `block (2 levels) in process_request'\n/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8.7/lib/active_support/callbacks.rb:99:in `run_callbacks'\n/app/vendor/bundle/ruby/3.2.0/gems/jsonapi-resources-0.10.7/lib/jsonapi/acts_as_resource_controller.rb:96:in `block in process_request'\n/app/vendor/bundle/ruby/3.2.0/gems/jsonapi-resources-0.10.7/lib/jsonapi/acts_as_resource_controller.rb:127:in `block (2 levels) in process_operations'\n/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'\n/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'\n/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'\n/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'\n/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'\n/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'\n/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/database_statements.rb:316:in `transaction'\n/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8.7/lib/active_record/transactions.rb:209:in `transaction'\n/app/vendor/bundle/ruby/3.2.0/gems/jsonapi-resources-0.10.7/lib/jsonapi/acts_as_resource_controller.rb:126:in `block in process_operations'\n/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8.7/lib/active_support/callbacks.rb:99:in `run_callbacks'\n/app/vendor/bundle/ruby/3.2.0/gems/jsonapi-resources-0.10.7/lib/jsonapi/acts_as_resource_controller.rb:125:in `process_operations'\n/app/vendor/bundle/ruby/3.2.0/gems/jsonapi-resources-0.10.7/lib/jsonapi/acts_as_resource_controller.rb:95:in `process_request'\n/app/vendor/bundle/ruby/3.2.0/gems/jsonapi-resources-0.10.7/lib/jsonapi/acts_as_resource_controller.rb:31:in `create'\n/app/vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.8.7/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'\n/app/vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.8.7/lib/abstract_controller/base.rb:215:in `process_action'\n/app/vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.8.7/lib/action_controller/metal/rendering.rb:165:in `process_action'\n/app/vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.8.7/lib/abstract_controller/callbacks.rb:234:in `block in process_action'\n/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8.7/lib/active_support/callbacks.rb:118:in `block in run_callbacks'\n```\n\nresource:\n```\nclass AuthorizeResource \u003c JSONAPI::Resource\n model_name 'AuthorizeV2'\n model_hint model: AuthorizeV2, resource: :authorize\n\n attributes [LIST OF ATTRIBUTES]\n\nend\n```\n\nmodel:\n```\nclass AuthorizeV2\n include ActiveModel::Model\n\n attr_accessor [LIST OF ATTRIBUTES]\nend\n```\n\n\n","author":{"url":"https://github.com/jrsimmons-trevipay","@type":"Person","name":"jrsimmons-trevipay"},"datePublished":"2025-02-24T20:56:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/1467/jsonapi-resources/issues/1467"}
| 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:2b0686ff-0283-eafe-895f-c1de5559d3ed |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CB5E:25572C:21CEAEF:2E4D2ED:6A4EC6DC |
| html-safe-nonce | 56735aab5d002ab2d96091d4a91bf8b4d3fba3a4e70dcc500a0778f0a3529efd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjVFOjI1NTcyQzoyMUNFQUVGOjJFNEQyRUQ6NkE0RUM2REMiLCJ2aXNpdG9yX2lkIjoiNjkyNDA1NzIwMzYyMDg5MDMzMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a8fc530e02bb94fe814809f4988541174e225be414582134d160d9466fbd786b |
| hovercard-subject-tag | issue:2876131368 |
| 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/JSONAPI-Resources/jsonapi-resources/1467/issue_layout |
| twitter:image | https://opengraph.githubassets.com/555ac005499d05cccf65143c788734df75afaf19f2c83d70609f3db3e230bd89/JSONAPI-Resources/jsonapi-resources/issues/1467 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/555ac005499d05cccf65143c788734df75afaf19f2c83d70609f3db3e230bd89/JSONAPI-Resources/jsonapi-resources/issues/1467 |
| og:image:alt | We just tried moving from v0.9.12 to v0.10.7 (and even tried with lower 10.x versions) and now our ActiveModel based models no longer work via resources. We now get a Internal Server Error: undefin... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jrsimmons-trevipay |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| turbo-cache-control | no-preview |
| go-import | github.com/JSONAPI-Resources/jsonapi-resources git https://github.com/JSONAPI-Resources/jsonapi-resources.git |
| octolytics-dimension-user_id | 262422067 |
| octolytics-dimension-user_login | JSONAPI-Resources |
| octolytics-dimension-repository_id | 18248068 |
| octolytics-dimension-repository_nwo | JSONAPI-Resources/jsonapi-resources |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 18248068 |
| octolytics-dimension-repository_network_root_nwo | JSONAPI-Resources/jsonapi-resources |
| 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 | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width