summaryrefslogtreecommitdiff
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-03-06 23:59:03 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-03-06 23:59:03 -0500
commitb791affde0729dc539fe543931dba46cf520e3fc (patch)
treec656dd5b3396257b57b5a8bb574f9fd815de7f6d /app/models/user.rb
parente74879dd4769e8bed34085ee3f978fc4a31366cb (diff)
add all the has_and_belongs_to_many relations
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index bd1a9ac..6e439fb 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1,6 +1,7 @@
class User < ActiveRecord::Base
has_and_belongs_to_many :tournaments_played, class_name: "Tournament", foreign_key: "player_id", join_table: "players_tournaments"
has_and_belongs_to_many :tournaments_hosted, class_name: "Tournament", foreign_key: "host_id", join_table: "hosts_tournaments"
+ has_and_belongs_to_many :teams
before_save { self.email = email.downcase }
before_save { self.user_name = user_name }