def reflection_by_name(klass, name)
      return if name.nil?
      klass.reflections[name.to_sym] || klass.reflections[name.to_s]
    end
def reflection_by_name(klass, name)
      return if name.nil?
      klass.reflections[name.to_sym] || klass.reflections[name.to_s]
    end
Returns a reflection for a given klass and name