class ActiveRecord::Associations::Association

def marshal_dump

We can't dump @reflection and @through_reflection since it contains the scope proc
def marshal_dump
  ivars = (instance_variables - [:@reflection, :@through_reflection]).map { |name| [name, instance_variable_get(name)] }
  [@reflection.name, ivars]
end