app/models/service_learning/service_learning_position.rb
def open_for(obj)
      unless obj.nil?
        where("#{obj.class.name.foreign_key} = ? AND (person_id <=> 0 OR person_id IS NULL) ", obj) rescue []        
      else
        where("service_learning_course_id IS NULL AND (person_id <=> 0 OR person_id IS NULL) ") rescue []        
      end
    end
# Limits the list of placements to only those associated with the passed object but _also_ still considered and "open slot"
# (i.e., person_id is null)
Limits the list of placements to only those associated with the passed object but _also_ still considered and "open slot"
Limits the list of placements to only those associated with the passed object but _also_ still considered and " open slot "
def open_for(obj)
      unless obj.nil?
        where("#{obj.class.name.foreign_key} = ? AND (person_id <=> 0 OR person_id IS NULL) ", obj) rescue []        
      else
        where("service_learning_course_id IS NULL AND (person_id <=> 0 OR person_id IS NULL) ") rescue []        
      end
    end
def open_for ( obj ) unless obj . nil? where ( "#{obj.class.name.foreign_key} = ? AND (person_id <=> 0 OR person_id IS NULL) " , obj ) rescue [ ] else where ( "service_learning_course_id IS NULL AND (person_id <=> 0 OR person_id IS NULL) " ) rescue [ ] end end
Limits the list of placements to only those associated with the passed object but _also_ still considered and "open slot"
(i.e., person_id is null)
Limits the list of placements to only those associated with the passed object but _also_ still considered and " open slot " ( i . e . person_id is null )
obj