metamaps--metamaps/app/models/follow_reason.rb

14 lines
313 B
Ruby
Raw Permalink Normal View History

# frozen_string_literal: true
2017-11-06 16:15:18 +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
validates :follow, presence: true
2017-11-06 16:15:18 +00:00
def has_reason
created || commented || contributed || followed || shared_on || starred
end
2017-11-06 16:15:18 +00:00
end