app/models/service_learning/service_learning_position.rb
def for(obj)
      if obj.is_a? Student
        where("#{obj.class.superclass.name.foreign_key} = ?", obj) rescue []
      else
        where("#{obj.class.name.foreign_key} = ?", obj) rescue []
      end
    end
# Limits the list of placements to only those associated with the passed object. _Obj_ can be either a ServiceLearningCourse or Person.
Limits the list of placements to only those associated with the passed object. _Obj_ can be either a ServiceLearningCourse or Person.
Limits the list of placements to only those associated with the passed object . _Obj_ can be either a ServiceLearningCourse or Person .
def for(obj)
      if obj.is_a? Student
        where("#{obj.class.superclass.name.foreign_key} = ?", obj) rescue []
      else
        where("#{obj.class.name.foreign_key} = ?", obj) rescue []
      end
    end
def for ( obj ) if obj . is_a? Student where ( "#{obj.class.superclass.name.foreign_key} = ?" , obj ) rescue [ ] else where ( "#{obj.class.name.foreign_key} = ?" , obj ) rescue [ ] end end
Limits the list of placements to only those associated with the passed object.
Limits the list of placements to only those associated with the passed object .
obj