summaryrefslogtreecommitdiff
path: root/app/models/concerns/calloutable.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/concerns/calloutable.rb')
-rw-r--r--app/models/concerns/calloutable.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/models/concerns/calloutable.rb b/app/models/concerns/calloutable.rb
new file mode 100644
index 00000000000..8b9cfae6a32
--- /dev/null
+++ b/app/models/concerns/calloutable.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+module Calloutable
+ extend ActiveSupport::Concern
+
+ included do
+ belongs_to :user
+
+ validates :user, presence: true
+ end
+
+ def dismissed_after?(dismissed_after)
+ dismissed_at > dismissed_after
+ end
+end