Retrospring/app/models/relationship.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

9 lines
248 B
Ruby
Raw Normal View History

2020-04-18 15:59:18 -07:00
class Relationship < ApplicationRecord
2014-11-30 05:43:35 -08:00
belongs_to :source, class_name: 'User'
belongs_to :target, class_name: 'User'
validates :source_id, presence: true
validates :target_id, presence: true
2014-12-14 05:58:29 -08:00
default_scope { order(created_at: :asc) }
2014-11-30 05:06:05 -08:00
end