Skip to content

Commit

Permalink
add todos
Browse files Browse the repository at this point in the history
  • Loading branch information
ezekg committed Dec 13, 2023
1 parent dfc2c64 commit 0d167f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/models/policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ class EmptyPoolError < StandardError; end

belongs_to :product
has_many :licenses, dependent: :destroy_async
# TODO(ezekg) Remove the :user source once we migrate to multi-user licenses.
has_many :users, -> { distinct.reorder(created_at: DEFAULT_SORT_ORDER) }, through: :licenses, source: :user
has_many :machines, through: :licenses
has_many :pool, class_name: "Key", dependent: :destroy_async
Expand Down
1 change: 1 addition & 0 deletions app/models/product.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Product < ApplicationRecord
has_many :keys, through: :policies, source: :pool
has_many :licenses, through: :policies
has_many :machines, -> { distinct.reorder(created_at: DEFAULT_SORT_ORDER) }, through: :licenses
# TODO(ezekg) Remove the :user source once we migrate to multi-user licenses.
has_many :users, -> { distinct.reorder(created_at: DEFAULT_SORT_ORDER) }, through: :licenses, source: :user
has_many :tokens, as: :bearer, dependent: :destroy_async
has_many :releases, inverse_of: :product, dependent: :destroy_async
Expand Down

0 comments on commit 0d167f3

Please sign in to comment.