Sha256: 008d68a34eca485b044f27d72fc6e5bb0d97a1ada1b6a32165256fca7bbceef0

Contents?: true

Size: 320 Bytes

Versions: 3

Compression:

Stored size: 320 Bytes

Contents

require_relative './application_record'

class Relationship < ApplicationRecord
  belongs_to :follower, class_name: "User", counter_cache: :followings_count
  belongs_to :followed, class_name: "User", counter_cache: :followers_count

  validates :follower_id, presence: true
  validates :followed_id, presence: true
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
active_hash_relation-1.4.1 spec/models/relationship.rb
active_hash_relation-1.4.0 spec/models/relationship.rb
active_hash_relation-1.2.0 spec/models/relationship.rb