Follow-up from "Add NuGet package tags support"
The following discussion from !30726 (merged) should be addressed:
-
@mayra-cabrera started a discussion: We could use
package_file.package_id
instead of fetchingpackage
and then selecting theid
:[8] pry(main)> package_file = Packages::PackageFile.last Packages::PackageFile Load (0.5ms) SELECT "packages_package_files".* FROM "packages_package_files" ORDER BY "packages_package_files"."id" DESC LIMIT 1 => #<Packages::PackageFile:0x00007f8be401ce90 id: 25, package_id: 25, created_at: Tue, 07 Apr 2020 23:13:43 UTC +00:00, updated_at: Tue, 07 Apr 2020 23:13:43 UTC +00:00, size: 6, file_store: 1, file_md5: nil, file_sha1: "f572d396fae9206628714fb2ce00f72e94f2258f", file_name: "@flightjs/npm_package_4-1.12.4.tgz", file: "@flightjs/npm_package_4-1.12.4.tgz", file_sha256: nil, verification_retry_at: nil, verified_at: nil, verification_checksum: nil, verification_failure: nil, verification_retry_count: nil> [9] pry(main)> package_file.package_id => 25 [10] pry(main)> package_file.package.id Packages::Package Load (8.5ms) SELECT "packages_packages".* FROM "packages_packages" WHERE "packages_packages"."id" = 25 LIMIT 1 => 25