Class: SpudRole
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- SpudRole
- Defined in:
- app/models/spud_role.rb
Instance Method Summary collapse
- #permission_tags ⇒ Object
- #permission_tags=(tags) ⇒ Object
- #permissions ⇒ Object
- #permissions=(permissions_list) ⇒ Object
Instance Method Details
#permission_tags ⇒ Object
27 28 29 |
# File 'app/models/spud_role.rb', line 27 def return self..collect(&:tag) end |
#permission_tags=(tags) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'app/models/spud_role.rb', line 16 def () self..each do || if ..nil? || !.include?(..tag) .destroy() else .delete(..tag) end end self. += .collect{ |tag| SpudRolePermission.new(:spud_permission_tag => tag) } end |
#permissions ⇒ Object
8 9 10 |
# File 'app/models/spud_role.rb', line 8 def self..collect(&:permission).reject(&:blank?) end |
#permissions=(permissions_list) ⇒ Object
12 13 14 |
# File 'app/models/spud_role.rb', line 12 def () self. = .collect(&:tag) end |