put all associations together in the user model
This commit is contained in:
parent
cb0e82c88f
commit
5779c99896
1 changed files with 2 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue