put all associations together in the user model

This commit is contained in:
Stella Rouzi 2014-07-27 09:06:15 +03:00
parent cb0e82c88f
commit 5779c99896

View file

@ -12,12 +12,11 @@ class User < ActiveRecord::Base
:recoverable, :rememberable, :trackable, :validatable, :confirmable,
:omniauthable, omniauth_providers: [:novell, :google, :facebook]
has_and_belongs_to_many :roles
has_many :openids
attr_accessible :email, :password, :password_confirmation, :remember_me, :role_id, :role_ids,
:name, :email_public, :biography, :nickname, :affiliation
has_and_belongs_to_many :roles
has_many :openids
has_many :event_users, dependent: :destroy
has_many :events, -> { uniq }, through: :event_users
has_many :registrations, dependent: :destroy