Skip to content

Instantly share code, notes, and snippets.

@User195
Created December 11, 2013 23:31
Show Gist options
  • Save User195/7920483 to your computer and use it in GitHub Desktop.
Save User195/7920483 to your computer and use it in GitHub Desktop.
class Relationship < ActiveRecord::Base
attr_accessible :followed_id
belongs_to :follower, class_name: "User"
belongs_to :followed, class_name: "User"
validates :follower_id, presence: true
validates :followed_id, presence: true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment