Module: Capable::ActsAsCapability::InstanceMethods
- Defined in:
- lib/acts_as_capability.rb
Instance Method Summary collapse
Instance Method Details
#renew(expires_at) ⇒ Object
53 54 55 56 57 |
# File 'lib/acts_as_capability.rb', line 53 def renew(expires_at) self.expires_at = expires_at self.active = (expires_at.nil? or expires_at > Time.now) self.save end |
#update_capables ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'lib/acts_as_capability.rb', line 44 def update_capables if self.capable.respond_to? :ability_list= self.capable.ability_list = self.capable.abilities.pluck(:ability).uniq.join(",") self.capable.save! else puts "CAPABILITY_ERROR: Accessor method 'ability_list' is not defined for the class '#{self.capable_type}'" if Capable.configuration[:verbose] end end |