Skip to content

Commit 6183799

Browse files
committed
Add source and source type to categorizable to fix event create/edit error
1 parent 538ccf1 commit 6183799

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/models/concerns/better_together/categorizable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def categorizable(class_name: category_class_name) # rubocop:todo Metrics/Method
1414
self.category_class_name = class_name
1515

1616
has_many :categorizations, class_name: 'BetterTogether::Categorization', as: :categorizable, dependent: :destroy
17-
has_many :categories, through: :categorizations do
17+
has_many :categories, through: :categorizations, source: :category, source_type: category_class_name do
1818
def with_cover_images # rubocop:todo Lint/NestedMethodDefinition
1919
left_joins(:cover_image_attachment).where.not(active_storage_attachments: { id: nil })
2020
end

0 commit comments

Comments
 (0)