module Capable::ActsAsCapability::InstanceMethods

Public Instance Methods

renew(expires_at) click to toggle source
# 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() click to toggle source
# 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