So now we'll be able to add them to other sections. We're also adding a `dependent: :destroy` relation to models having cards since it doesn't make sense to have cards around when their page has been destroyed.
8 lines
157 B
Ruby
8 lines
157 B
Ruby
module Cardable
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
has_many :cards, class_name: "Widget::Card", as: :cardable, dependent: :destroy
|
|
end
|
|
end
|