Adding user_certifications relation, and paperclip gem
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
class Certification < ActiveRecord::Base
|
||||
attr_accessible :description, :name
|
||||
has_many :users, :through => :certifications_users
|
||||
has_many :user_certifications
|
||||
has_many :users, :through => :user_certifications
|
||||
end
|
||||
|
||||
@@ -6,8 +6,9 @@ class User < ActiveRecord::Base
|
||||
:recoverable, :rememberable, :trackable, :validatable
|
||||
|
||||
# Setup accessible (or protected) attributes for your model
|
||||
attr_accessible :email, :password, :password_confirmation, :remember_me, :name, :admin, :instructor, :active, :emergency_name, :emergency_phone, :current_skills, :desired_skills, :waiver, :emergency_email, :phone, :payment_method, :orientation, :member_level
|
||||
attr_accessible :email, :password, :password_confirmation, :remember_me, :name, :admin, :instructor, :active, :emergency_name, :emergency_phone, :current_skills, :desired_skills, :waiver, :emergency_email, :phone, :payment_method, :orientation, :member_level, :certifications
|
||||
|
||||
has_many :cards
|
||||
has_many :certifications, :through => :certifications_users
|
||||
has_many :user_certifications
|
||||
has_many :certifications, :through => :user_certifications
|
||||
end
|
||||
|
||||
5
app/models/user_certification.rb
Normal file
5
app/models/user_certification.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class UserCertification < ActiveRecord::Base
|
||||
attr_accessible :certification_id, :user_id
|
||||
belongs_to :user
|
||||
belongs_to :certification
|
||||
end
|
||||
Reference in New Issue
Block a user