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