Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes based on rbs research #12922

Merged
merged 2 commits into from
Jun 21, 2023
Merged

Conversation

klaustopher
Copy link
Contributor

@klaustopher klaustopher commented Jun 21, 2023

While working on #12916 the type checker has identified those 2 issues. Regardless of if the PR gets merged, those fixes should be implemented.

# Current dev
[1] pry(main)> WorkPackageCustomField.first.work_packages
  WorkPackageCustomField Load (2.6ms)  SELECT "custom_fields".* FROM "custom_fields" WHERE "custom_fields"."type" = $1 ORDER BY "custom_fields"."id" ASC LIMIT $2  [["type", "WorkPackageCustomField"], ["LIMIT", 1]]
ActiveRecord::HasManyThroughAssociationNotFoundError: Could not find the association :work_package_custom_values in model WorkPackageCustomField
from /Users/klaustopher/.rvm/gems/ruby-3.2.1/gems/activerecord-7.0.5/lib/active_record/reflection.rb:944:in `check_validity!'

# This branch
[1] pry(main)> WorkPackageCustomField.first.work_packages
  WorkPackageCustomField Load (0.7ms)  SELECT "custom_fields".* FROM "custom_fields" WHERE "custom_fields"."type" = $1 ORDER BY "custom_fields"."id" ASC LIMIT $2  [["type", "WorkPackageCustomField"], ["LIMIT", 1]]
  WorkPackage Load (13.2ms)  SELECT "work_packages".* FROM "work_packages" INNER JOIN "custom_values" ON "work_packages"."id" = "custom_values"."customized_id" WHERE "custom_values"."custom_field_id" = $1 AND "custom_values"."customized_type" = $2  [["custom_field_id", 1], ["customized_type", "WorkPackage"]]
=> [#<WorkPackage:0x000000010dd2a128 ...>]

@klaustopher klaustopher requested a review from a team June 21, 2023 06:09
@oliverguenther oliverguenther merged commit 24a322d into dev Jun 21, 2023
@oliverguenther oliverguenther deleted the small-fixes-based-on-rbs-research branch June 21, 2023 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants