2017-02-11 00:20:42 -05:00
|
|
|
# frozen_string_literal: true
|
2017-11-25 11:23:47 -08:00
|
|
|
|
2017-02-11 00:20:42 -05:00
|
|
|
class FollowReason < ApplicationRecord
|
2018-01-20 14:10:26 -08:00
|
|
|
REASONS = %w[created commented contributed followed shared_on starred].freeze
|
2017-02-11 00:20:42 -05:00
|
|
|
|
|
|
|
belongs_to :follow
|
2017-11-25 11:23:47 -08:00
|
|
|
|
2017-02-11 00:20:42 -05:00
|
|
|
validates :follow, presence: true
|
2017-11-25 11:23:47 -08:00
|
|
|
|
2017-02-11 00:20:42 -05:00
|
|
|
def has_reason
|
|
|
|
created || commented || contributed || followed || shared_on || starred
|
|
|
|
end
|
2017-11-25 11:23:47 -08:00
|
|
|
end
|