Adding certifications; messed up adding certification_users so not staging those
This commit is contained in:
@@ -5,10 +5,14 @@ class Ability
|
||||
if !user.nil?
|
||||
if user.admin?
|
||||
can :manage, :all
|
||||
else
|
||||
can :read, User
|
||||
can :read, Card, :user_id => user.id
|
||||
end
|
||||
if user.instructor?
|
||||
can :manage, Certification
|
||||
end
|
||||
|
||||
can :read, User
|
||||
can :read, Certification
|
||||
can :read, Card, :user_id => user.id
|
||||
end
|
||||
# Define abilities for the passed in user here. For example:
|
||||
#
|
||||
|
||||
4
app/models/certification.rb
Normal file
4
app/models/certification.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
class Certification < ActiveRecord::Base
|
||||
attr_accessible :description, :name
|
||||
has_many :users, :through => :certifications_users
|
||||
end
|
||||
@@ -6,7 +6,8 @@ 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, :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
|
||||
|
||||
has_many :cards
|
||||
has_many :certifications, :through => :certifications_users
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user