Skip to content

Instantly share code, notes, and snippets.

@apneadiving
Created November 28, 2016 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apneadiving/44ed42c0540f0857e07cc64f235f4752 to your computer and use it in GitHub Desktop.
Save apneadiving/44ed42c0540f0857e07cc64f235f4752 to your computer and use it in GitHub Desktop.
# User model
class User < ActiveRecord::Base
has_many :invitations
end
# Invitation Model
class Invitation < ActiveRecord::Base
belongs_to :inviter, class_name: 'User'
def accept
self.accepted = true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment