Files
growstuff/app/models/like.rb
Daniel O'Connor ec955f4f06 Revert "Brakeman complaint"
This reverts commit 35b08f88f5.
2022-11-06 17:36:42 +10:30

9 lines
264 B
Ruby

# frozen_string_literal: true
class Like < ApplicationRecord
belongs_to :member
belongs_to :likeable, polymorphic: true, counter_cache: true, touch: true
validates :member, :likeable, presence: true
validates :member, uniqueness: { scope: :likeable }
end