From 23c2b8f6bb35d8a2af41c282ae02824e95c3fbd3 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Thu, 2 Mar 2017 12:02:33 -0500 Subject: Add `has_many` associations for models that can have Upload records --- app/models/group.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app/models/group.rb') diff --git a/app/models/group.rb b/app/models/group.rb index 7d23f655225..a1f12ed55ea 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -28,6 +28,7 @@ class Group < Namespace validates :avatar, file_size: { maximum: 200.kilobytes.to_i } mount_uploader :avatar, AvatarUploader + has_many :uploads, as: :model, dependent: :destroy after_create :post_create_hook after_destroy :post_destroy_hook -- cgit v1.2.1