summaryrefslogtreecommitdiff
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-03-06 21:31:18 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-03-06 21:31:18 -0500
commit64d4bd0d7bff0bf0e1c405bfa154f22775ca724e (patch)
tree1706940a8a104735bf5442190fb0aebc32f8d224 /app/models/user.rb
parent5f8baf6334f427506193ea8efd1356812468e191 (diff)
use had_and_belongs_to_many
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index bad7f7b..0a226e5 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1,6 +1,6 @@
class User < ActiveRecord::Base
- has_many :user_tournament_pairs
- has_many :tournaments, :through => :user_tournament_pairs
+ has_and_belongs_to_many :tournaments_played, class_name: "Tournament", join_table: "tournaments_players"
+ has_and_belongs_to_many :tournaments_hosted, class_name: "Tournament", join_table: "tournaments_hosts"
before_save { self.email = email.downcase }
before_save { self.user_name = user_name }