Skip to content

Commit

Permalink
adds a scope for loading the CF with the root and 2 levels of children
Browse files Browse the repository at this point in the history
  • Loading branch information
mereghost committed Oct 23, 2024
1 parent 9aae322 commit 89ce5f2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/custom_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class CustomField < ApplicationRecord
dependent: :destroy,
inverse_of: "custom_field"

scope :hierarchy_root_and_children, -> { includes(hierarchy_root: { children: :children }) }

acts_as_list scope: [:type]

validates :field_format, presence: true
Expand Down

0 comments on commit 89ce5f2

Please sign in to comment.