2017-02-11 05:20:42 +00:00
|
|
|
# frozen_string_literal: true
|
2017-11-06 16:15:18 +00:00
|
|
|
|
2017-02-11 05:20:42 +00:00
|
|
|
class FollowReason < ApplicationRecord
|
|
|
|
REASONS = %w(created commented contributed followed shared_on starred).freeze
|
|
|
|
|
|
|
|
belongs_to :follow
|
2017-11-06 16:15:18 +00:00
|
|
|
|
2017-02-11 05:20:42 +00:00
|
|
|
validates :follow, presence: true
|
2017-11-06 16:15:18 +00:00
|
|
|
|
2017-02-11 05:20:42 +00:00
|
|
|
def has_reason
|
|
|
|
created || commented || contributed || followed || shared_on || starred
|
|
|
|
end
|
2017-11-06 16:15:18 +00:00
|
|
|
end
|