app/models/patient.rb
def authorized_for?(*args)
    return false if current_user.nil?               # If current_user is not defined or the model is accessed outside of the request/response cycle, bail out
    is_allowed = current_user.can_do( :appointments, args[0][:action] )

    return is_allowed && multi_appointment_receipt_allowed? if args[0][:column].blank? && (args[0][:action] == :issue_receipt)
    return is_allowed
  end
# Custom security check for the custom :issue_receipt action.
#
Custom security check for the custom :issue_receipt action.
Custom security check for the custom : issue_receipt action .
def authorized_for?(*args)
    return false if current_user.nil?               
    is_allowed = current_user.can_do( :appointments, args[0][:action] )
    return is_allowed && multi_appointment_receipt_allowed? if args[0][:column].blank? && (args[0][:action] == :issue_receipt)
    return is_allowed
  end
def authorized_for? ( * args ) return false if current_user . nil? is_allowed = current_user . can_do ( :appointments , args [ 0 ] [ :action ] ) return is_allowed && multi_appointment_receipt_allowed? if args [ 0 ] [ :column ] . blank? && ( args [ 0 ] [ :action ] == :issue_receipt ) return is_allowed end
Custom security check for the custom :issue_receipt action.
Custom security check for the custom : issue_receipt action .
# If current_user is not defined or the model is accessed outside of the request/response cycle, bail out
args