Method: Client#authorized_for?
- Defined in:
- app/models/client.rb
#authorized_for?(options) ⇒ Boolean
73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'app/models/client.rb', line 73 def () return true unless .try(:[],:action) case [:action].to_sym when :delete [Invoice, Payment, Activity].each{ |k| return false if k.count(:all, :conditions => ['client_id = ?', id] ) > 0 } true else true end end |